2013-09-20 13:11:25 +04: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 17:37:18 +03:00
|
|
|
class LoadContextInfo final : public nsILoadContextInfo {
|
2013-09-20 13:11:25 +04:00
|
|
|
public:
|
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
|
|
|
NS_DECL_NSILOADCONTEXTINFO
|
|
|
|
|
2017-01-12 19:38:48 +03:00
|
|
|
LoadContextInfo(bool aIsAnonymous, OriginAttributes aOriginAttributes);
|
2013-09-20 13:11:25 +04:00
|
|
|
|
|
|
|
private:
|
2018-04-30 19:46:04 +03:00
|
|
|
virtual ~LoadContextInfo() = default;
|
2013-09-20 13:11:25 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool mIsAnonymous : 1;
|
2017-01-12 19:38:48 +03:00
|
|
|
OriginAttributes mOriginAttributes;
|
2013-09-20 13:11:25 +04:00
|
|
|
};
|
|
|
|
|
2015-10-11 19:13:09 +03:00
|
|
|
class LoadContextInfoFactory : public nsILoadContextInfoFactory {
|
2018-04-30 19:46:04 +03:00
|
|
|
virtual ~LoadContextInfoFactory() = default;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2015-10-11 19:13:09 +03: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 13:11:25 +04:00
|
|
|
|
2015-10-11 19:13:09 +03:00
|
|
|
LoadContextInfo* GetLoadContextInfo(nsIDOMWindow* aLoadContext,
|
|
|
|
bool aIsAnonymous);
|
2013-09-20 13:11:25 +04:00
|
|
|
|
2015-10-11 19:13:09 +03:00
|
|
|
LoadContextInfo* GetLoadContextInfo(nsILoadContextInfo* aInfo);
|
2013-09-20 13:11:25 +04:00
|
|
|
|
2016-08-24 01:07:56 +03:00
|
|
|
LoadContextInfo* GetLoadContextInfo(bool const aIsAnonymous,
|
2017-01-12 19:38:48 +03:00
|
|
|
OriginAttributes const& aOriginAttributes);
|
2013-09-20 13:11:25 +04:00
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
2013-09-20 13:11:25 +04:00
|
|
|
|
|
|
|
#endif
|