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"
16 class LoadContextInfo final
: public nsILoadContextInfo
{
18 NS_DECL_THREADSAFE_ISUPPORTS
19 NS_DECL_NSILOADCONTEXTINFO
21 LoadContextInfo(bool aIsAnonymous
, OriginAttributes aOriginAttributes
);
24 virtual ~LoadContextInfo() = default;
27 bool mIsAnonymous
: 1;
28 OriginAttributes mOriginAttributes
;
31 class LoadContextInfoFactory
: public nsILoadContextInfoFactory
{
32 virtual ~LoadContextInfoFactory() = default;
35 NS_DECL_ISUPPORTS
// deliberately not thread-safe
36 NS_DECL_NSILOADCONTEXTINFOFACTORY
39 LoadContextInfo
* GetLoadContextInfo(nsIChannel
* aChannel
);
41 LoadContextInfo
* GetLoadContextInfo(nsILoadContext
* aLoadContext
,
44 LoadContextInfo
* GetLoadContextInfo(nsIDOMWindow
* aWindow
, bool aIsAnonymous
);
46 LoadContextInfo
* GetLoadContextInfo(nsILoadContextInfo
* aInfo
);
48 LoadContextInfo
* GetLoadContextInfo(bool const aIsAnonymous
,
49 OriginAttributes
const& aOriginAttributes
);
52 } // namespace mozilla