2012-08-07 04:47:48 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2015-02-13 19:36:47 +00:00
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-08-07 04:47:48 +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 LoadContext_h
|
|
|
|
#define LoadContext_h
|
|
|
|
|
|
|
|
#include "SerializedLoadContext.h"
|
2012-08-10 18:28:07 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2015-09-23 08:10:21 +00:00
|
|
|
#include "mozilla/BasePrincipal.h"
|
2013-09-03 20:17:26 +00:00
|
|
|
#include "nsIWeakReferenceUtils.h"
|
2013-07-23 23:39:17 +00:00
|
|
|
#include "mozilla/dom/Element.h"
|
2013-08-19 19:31:24 +00:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2013-10-02 20:09:18 +00:00
|
|
|
#include "nsILoadContext.h"
|
2012-12-29 09:02:16 +00:00
|
|
|
|
2012-08-07 04:47:48 +00:00
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class that provides nsILoadContext info in Parent process. Typically copied
|
|
|
|
* from Child via SerializedLoadContext.
|
|
|
|
*
|
|
|
|
* Note: this is not the "normal" or "original" nsILoadContext. That is
|
2020-05-07 22:49:06 +00:00
|
|
|
* typically provided by BrowsingContext. This is only used when the original
|
2012-08-07 04:47:48 +00:00
|
|
|
* docshell is in a different process and we need to copy certain values from
|
|
|
|
* it.
|
|
|
|
*/
|
|
|
|
|
2015-02-13 19:36:37 +00:00
|
|
|
class LoadContext final : public nsILoadContext, public nsIInterfaceRequestor {
|
2012-08-07 04:47:48 +00:00
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSILOADCONTEXT
|
2013-08-19 19:31:24 +00:00
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
2012-08-07 04:47:48 +00:00
|
|
|
|
2012-12-29 09:02:16 +00:00
|
|
|
LoadContext(const IPC::SerializedLoadContext& aToCopy,
|
2020-05-07 22:49:06 +00:00
|
|
|
dom::Element* aTopFrameElement, OriginAttributes& aAttrs);
|
2014-01-11 01:10:57 +00:00
|
|
|
|
2016-05-19 07:49:41 +00:00
|
|
|
// Constructor taking reserved origin attributes.
|
2020-05-07 22:49:06 +00:00
|
|
|
explicit LoadContext(OriginAttributes& aAttrs);
|
2013-08-19 19:31:24 +00:00
|
|
|
|
2019-05-03 17:13:17 +00:00
|
|
|
// Constructor for creating a LoadContext with a given browser flag.
|
2015-02-21 15:09:17 +00:00
|
|
|
explicit LoadContext(nsIPrincipal* aPrincipal,
|
|
|
|
nsILoadContext* aOptionalBase = nullptr);
|
2014-12-12 16:05:00 +00:00
|
|
|
|
2012-08-07 04:47:48 +00:00
|
|
|
private:
|
2020-05-07 22:49:06 +00:00
|
|
|
~LoadContext();
|
2014-06-23 18:49:08 +00:00
|
|
|
|
2015-02-13 19:36:37 +00:00
|
|
|
nsWeakPtr mTopFrameElement;
|
|
|
|
bool mIsContent;
|
|
|
|
bool mUseRemoteTabs;
|
2019-04-17 00:53:22 +00:00
|
|
|
bool mUseRemoteSubframes;
|
2017-02-14 14:53:21 +00:00
|
|
|
bool mUseTrackingProtection;
|
2013-06-23 07:15:05 +00:00
|
|
|
#ifdef DEBUG
|
2015-02-13 19:36:37 +00:00
|
|
|
bool mIsNotNull;
|
2013-06-23 07:15:05 +00:00
|
|
|
#endif
|
2019-04-08 20:30:37 +00:00
|
|
|
OriginAttributes mOriginAttributes;
|
2012-08-07 04:47:48 +00:00
|
|
|
};
|
|
|
|
|
2018-09-15 15:38:45 +00:00
|
|
|
already_AddRefed<nsILoadContext> CreateLoadContext();
|
|
|
|
already_AddRefed<nsILoadContext> CreatePrivateLoadContext();
|
2017-04-09 02:02:16 +00:00
|
|
|
|
2012-08-07 04:47:48 +00:00
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // LoadContext_h
|