Merge mozilla-central to autoland. CLOSED TREE
[gecko.git] / netwerk / base / LoadContextInfo.h
blobefaf912db45fa35c08481f45fb0abaabbc72307a
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 nsLoadContextInfo_h__
6 #define nsLoadContextInfo_h__
8 #include "nsILoadContextInfo.h"
10 class nsIChannel;
11 class nsILoadContext;
13 namespace mozilla {
14 namespace net {
16 class LoadContextInfo final : public nsILoadContextInfo {
17 public:
18 NS_DECL_THREADSAFE_ISUPPORTS
19 NS_DECL_NSILOADCONTEXTINFO
21 LoadContextInfo(bool aIsAnonymous, OriginAttributes aOriginAttributes);
23 private:
24 virtual ~LoadContextInfo() = default;
26 protected:
27 bool mIsAnonymous : 1;
28 OriginAttributes mOriginAttributes;
31 class LoadContextInfoFactory : public nsILoadContextInfoFactory {
32 virtual ~LoadContextInfoFactory() = default;
34 public:
35 NS_DECL_ISUPPORTS // deliberately not thread-safe
36 NS_DECL_NSILOADCONTEXTINFOFACTORY
39 LoadContextInfo* GetLoadContextInfo(nsIChannel* aChannel);
41 LoadContextInfo* GetLoadContextInfo(nsILoadContext* aLoadContext,
42 bool aIsAnonymous);
44 LoadContextInfo* GetLoadContextInfo(nsIDOMWindow* aWindow, bool aIsAnonymous);
46 LoadContextInfo* GetLoadContextInfo(nsILoadContextInfo* aInfo);
48 LoadContextInfo* GetLoadContextInfo(bool const aIsAnonymous,
49 OriginAttributes const& aOriginAttributes);
51 } // namespace net
52 } // namespace mozilla
54 #endif