2013-09-20 09:11:25 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef nsLoadContextInfo_h__
|
|
|
|
#define nsLoadContextInfo_h__
|
|
|
|
|
|
|
|
#include "nsILoadContextInfo.h"
|
|
|
|
|
|
|
|
class nsIChannel;
|
|
|
|
class nsILoadContext;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
2018-03-09 14:37:18 +00:00
|
|
|
class LoadContextInfo final : public nsILoadContextInfo {
|
2013-09-20 09:11:25 +00:00
|
|
|
public:
|
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
|
|
|
NS_DECL_NSILOADCONTEXTINFO
|
|
|
|
|
2017-01-12 16:38:48 +00:00
|
|
|
LoadContextInfo(bool aIsAnonymous, OriginAttributes aOriginAttributes);
|
2013-09-20 09:11:25 +00:00
|
|
|
|
|
|
|
private:
|
2018-04-30 16:46:04 +00:00
|
|
|
virtual ~LoadContextInfo() = default;
|
2013-09-20 09:11:25 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool mIsAnonymous : 1;
|
2017-01-12 16:38:48 +00:00
|
|
|
OriginAttributes mOriginAttributes;
|
2013-09-20 09:11:25 +00:00
|
|
|
};
|
|
|
|
|
2015-10-11 16:13:09 +00:00
|
|
|
class LoadContextInfoFactory : public nsILoadContextInfoFactory {
|
2018-04-30 16:46:04 +00:00
|
|
|
virtual ~LoadContextInfoFactory() = default;
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2015-10-11 16:13:09 +00:00
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS // deliberately not thread-safe
|
|
|
|
NS_DECL_NSILOADCONTEXTINFOFACTORY
|
|
|
|
};
|
|
|
|
|
|
|
|
LoadContextInfo* GetLoadContextInfo(nsIChannel* aChannel);
|
|
|
|
|
|
|
|
LoadContextInfo* GetLoadContextInfo(nsILoadContext* aLoadContext,
|
|
|
|
bool aIsAnonymous);
|
2013-09-20 09:11:25 +00:00
|
|
|
|
2021-06-04 12:35:16 +00:00
|
|
|
LoadContextInfo* GetLoadContextInfo(nsIDOMWindow* aWindow, bool aIsAnonymous);
|
2013-09-20 09:11:25 +00:00
|
|
|
|
2015-10-11 16:13:09 +00:00
|
|
|
LoadContextInfo* GetLoadContextInfo(nsILoadContextInfo* aInfo);
|
2013-09-20 09:11:25 +00:00
|
|
|
|
2016-08-23 22:07:56 +00:00
|
|
|
LoadContextInfo* GetLoadContextInfo(bool const aIsAnonymous,
|
2017-01-12 16:38:48 +00:00
|
|
|
OriginAttributes const& aOriginAttributes);
|
2013-09-20 09:11:25 +00:00
|
|
|
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
2013-09-20 09:11:25 +00:00
|
|
|
|
|
|
|
#endif
|