Backed out 10 changesets (bug 1803810) for xpcshell failures on test_import_global...
[gecko.git] / netwerk / base / nsStreamTransportService.h
blob1229c0ca44b2aad21ced771845d99fb5178f5557
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef nsStreamTransportService_h__
6 #define nsStreamTransportService_h__
8 #include "nsIStreamTransportService.h"
9 #include "nsIEventTarget.h"
10 #include "nsIObserver.h"
11 #include "nsCOMPtr.h"
12 #include "nsTArray.h"
13 #include "nsThreadUtils.h"
14 #include "mozilla/Attributes.h"
15 #include "mozilla/DataMutex.h"
16 #include "mozilla/Mutex.h"
18 class nsIThreadPool;
20 namespace mozilla {
21 namespace net {
23 class nsStreamTransportService final : public nsIStreamTransportService,
24 public nsIEventTarget,
25 public nsIObserver {
26 public:
27 NS_DECL_THREADSAFE_ISUPPORTS
28 NS_DECL_NSISTREAMTRANSPORTSERVICE
29 NS_DECL_NSIEVENTTARGET_FULL
30 NS_DECL_NSIOBSERVER
32 nsresult Init();
34 nsStreamTransportService();
36 private:
37 ~nsStreamTransportService();
39 nsCOMPtr<nsIThreadPool> mPool MOZ_GUARDED_BY(mShutdownLock);
41 mozilla::Mutex mShutdownLock{"nsStreamTransportService.mShutdownLock"};
42 bool mIsShutdown MOZ_GUARDED_BY(mShutdownLock){false};
45 } // namespace net
46 } // namespace mozilla
47 #endif