Bug 1875768 - Call the appropriate postfork handler on MacOS r=glandium
[gecko.git] / netwerk / base / RequestContextService.h
blob4aafdb8ed683b665a74a1ed055d61d88fee0f1e8
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 ;*; */
2 /* vim: set sw=2 ts=8 et tw=80 : */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla__net__RequestContextService_h
8 #define mozilla__net__RequestContextService_h
10 #include "nsCOMPtr.h"
11 #include "nsInterfaceHashtable.h"
12 #include "nsIObserver.h"
13 #include "nsIRequestContext.h"
15 namespace mozilla {
16 namespace net {
18 class RequestContextService final : public nsIRequestContextService,
19 public nsIObserver {
20 public:
21 NS_DECL_ISUPPORTS
22 NS_DECL_NSIREQUESTCONTEXTSERVICE
23 NS_DECL_NSIOBSERVER
25 static already_AddRefed<nsIRequestContextService> GetOrCreate();
27 private:
28 RequestContextService();
29 virtual ~RequestContextService();
31 nsresult Init();
32 void Shutdown();
34 static RequestContextService* sSelf;
36 nsInterfaceHashtable<nsUint64HashKey, nsIRequestContext> mTable;
37 uint32_t mRCIDNamespace{0};
38 uint32_t mNextRCID{1};
41 } // namespace net
42 } // namespace mozilla
44 #endif // mozilla__net__RequestContextService_h