Bug 1612147 - Don't store FeaturePolicy in BrowsingContext. r=smaug
Syncing the container FeaturePolicy across BrowsingContext is actually a bit more heavy-handed than necessary. We only ever need a container FeaturePolicy when inheriting a FeaturePolicy in exactly the document the container contains. Not every process that the tree the container is a part of. So instead of storing a FeaturePolicy in a synced field, we manually send it to the correct WindowGlobalChild (which corresponds to a document) and retrieve it from there. Differential Revision: https://phabricator.services.mozilla.com/D61479
This commit is contained in:
@@ -27,7 +27,6 @@
|
|||||||
#include "mozilla/dom/ContentParent.h"
|
#include "mozilla/dom/ContentParent.h"
|
||||||
#include "mozilla/dom/Document.h"
|
#include "mozilla/dom/Document.h"
|
||||||
#include "mozilla/dom/Element.h"
|
#include "mozilla/dom/Element.h"
|
||||||
#include "mozilla/dom/FeaturePolicyUtils.h"
|
|
||||||
#include "mozilla/dom/HTMLEmbedElement.h"
|
#include "mozilla/dom/HTMLEmbedElement.h"
|
||||||
#include "mozilla/dom/HTMLIFrameElement.h"
|
#include "mozilla/dom/HTMLIFrameElement.h"
|
||||||
#include "mozilla/dom/Location.h"
|
#include "mozilla/dom/Location.h"
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
#include "mozilla/Span.h"
|
#include "mozilla/Span.h"
|
||||||
#include "mozilla/Tuple.h"
|
#include "mozilla/Tuple.h"
|
||||||
#include "mozilla/dom/BindingDeclarations.h"
|
#include "mozilla/dom/BindingDeclarations.h"
|
||||||
#include "mozilla/dom/FeaturePolicy.h"
|
|
||||||
#include "mozilla/dom/LocationBase.h"
|
#include "mozilla/dom/LocationBase.h"
|
||||||
#include "mozilla/dom/MaybeDiscarded.h"
|
#include "mozilla/dom/MaybeDiscarded.h"
|
||||||
#include "mozilla/dom/UserActivation.h"
|
#include "mozilla/dom/UserActivation.h"
|
||||||
@@ -120,7 +119,6 @@ enum class ExplicitActiveStatus : uint8_t {
|
|||||||
/* Hold the audio muted state and should be used on top level browsing \
|
/* Hold the audio muted state and should be used on top level browsing \
|
||||||
* contexts only */ \
|
* contexts only */ \
|
||||||
FIELD(Muted, bool) \
|
FIELD(Muted, bool) \
|
||||||
FIELD(FeaturePolicy, RefPtr<mozilla::dom::FeaturePolicy>) \
|
|
||||||
/* See nsSandboxFlags.h for the possible flags. */ \
|
/* See nsSandboxFlags.h for the possible flags. */ \
|
||||||
FIELD(SandboxFlags, uint32_t) \
|
FIELD(SandboxFlags, uint32_t) \
|
||||||
FIELD(InitialSandboxFlags, uint32_t) \
|
FIELD(InitialSandboxFlags, uint32_t) \
|
||||||
|
|||||||
@@ -1663,6 +1663,15 @@ void CanonicalBrowsingContext::ResetScalingZoom() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CanonicalBrowsingContext::SetContainerFeaturePolicy(
|
||||||
|
FeaturePolicy* aContainerFeaturePolicy) {
|
||||||
|
mContainerFeaturePolicy = aContainerFeaturePolicy;
|
||||||
|
|
||||||
|
if (WindowGlobalParent* current = GetCurrentWindowGlobal()) {
|
||||||
|
Unused << current->SendSetContainerFeaturePolicy(mContainerFeaturePolicy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CanonicalBrowsingContext::SetCrossGroupOpenerId(uint64_t aOpenerId) {
|
void CanonicalBrowsingContext::SetCrossGroupOpenerId(uint64_t aOpenerId) {
|
||||||
MOZ_DIAGNOSTIC_ASSERT(IsTopContent());
|
MOZ_DIAGNOSTIC_ASSERT(IsTopContent());
|
||||||
MOZ_DIAGNOSTIC_ASSERT(mCrossGroupOpenerId == 0,
|
MOZ_DIAGNOSTIC_ASSERT(mCrossGroupOpenerId == 0,
|
||||||
@@ -1671,7 +1680,7 @@ void CanonicalBrowsingContext::SetCrossGroupOpenerId(uint64_t aOpenerId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_CYCLE_COLLECTION_INHERITED(CanonicalBrowsingContext, BrowsingContext,
|
NS_IMPL_CYCLE_COLLECTION_INHERITED(CanonicalBrowsingContext, BrowsingContext,
|
||||||
mSessionHistory)
|
mSessionHistory, mContainerFeaturePolicy)
|
||||||
|
|
||||||
NS_IMPL_ADDREF_INHERITED(CanonicalBrowsingContext, BrowsingContext)
|
NS_IMPL_ADDREF_INHERITED(CanonicalBrowsingContext, BrowsingContext)
|
||||||
NS_IMPL_RELEASE_INHERITED(CanonicalBrowsingContext, BrowsingContext)
|
NS_IMPL_RELEASE_INHERITED(CanonicalBrowsingContext, BrowsingContext)
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ class DocumentLoadListener;
|
|||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
class BrowserParent;
|
class BrowserParent;
|
||||||
|
class FeaturePolicy;
|
||||||
struct LoadURIOptions;
|
struct LoadURIOptions;
|
||||||
class MediaController;
|
class MediaController;
|
||||||
struct LoadingSessionHistoryInfo;
|
struct LoadingSessionHistoryInfo;
|
||||||
@@ -263,6 +264,11 @@ class CanonicalBrowsingContext final : public BrowsingContext {
|
|||||||
|
|
||||||
void ResetScalingZoom();
|
void ResetScalingZoom();
|
||||||
|
|
||||||
|
void SetContainerFeaturePolicy(FeaturePolicy* aContainerFeaturePolicy);
|
||||||
|
FeaturePolicy* GetContainerFeaturePolicy() const {
|
||||||
|
return mContainerFeaturePolicy;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Called when the browsing context is being discarded.
|
// Called when the browsing context is being discarded.
|
||||||
void CanonicalDiscard();
|
void CanonicalDiscard();
|
||||||
@@ -367,6 +373,8 @@ class CanonicalBrowsingContext final : public BrowsingContext {
|
|||||||
RefPtr<nsSecureBrowserUI> mSecureBrowserUI;
|
RefPtr<nsSecureBrowserUI> mSecureBrowserUI;
|
||||||
RefPtr<BrowsingContextWebProgress> mWebProgress;
|
RefPtr<BrowsingContextWebProgress> mWebProgress;
|
||||||
RefPtr<nsBrowserStatusFilter> mStatusFilter;
|
RefPtr<nsBrowserStatusFilter> mStatusFilter;
|
||||||
|
|
||||||
|
RefPtr<FeaturePolicy> mContainerFeaturePolicy;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace dom
|
} // namespace dom
|
||||||
|
|||||||
@@ -81,6 +81,13 @@ Document* WindowContext::GetExtantDoc() const {
|
|||||||
return innerWindow ? innerWindow->GetExtantDoc() : nullptr;
|
return innerWindow ? innerWindow->GetExtantDoc() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WindowGlobalChild* WindowContext::GetWindowGlobalChild() const {
|
||||||
|
MOZ_ASSERT(XRE_IsContentProcess());
|
||||||
|
NS_ENSURE_TRUE(XRE_IsContentProcess(), nullptr);
|
||||||
|
nsGlobalWindowInner* innerWindow = GetInnerWindow();
|
||||||
|
return innerWindow ? innerWindow->GetWindowGlobalChild() : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
WindowContext* WindowContext::GetParentWindowContext() {
|
WindowContext* WindowContext::GetParentWindowContext() {
|
||||||
return mBrowsingContext->GetParentWindowContext();
|
return mBrowsingContext->GetParentWindowContext();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ class LogModule;
|
|||||||
|
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
|
class WindowGlobalChild;
|
||||||
class WindowGlobalParent;
|
class WindowGlobalParent;
|
||||||
class WindowGlobalInit;
|
class WindowGlobalInit;
|
||||||
class BrowsingContext;
|
class BrowsingContext;
|
||||||
@@ -112,6 +113,8 @@ class WindowContext : public nsISupports, public nsWrapperCache {
|
|||||||
Document* GetDocument() const;
|
Document* GetDocument() const;
|
||||||
Document* GetExtantDoc() const;
|
Document* GetExtantDoc() const;
|
||||||
|
|
||||||
|
WindowGlobalChild* GetWindowGlobalChild() const;
|
||||||
|
|
||||||
// Get the parent WindowContext of this WindowContext, taking the BFCache into
|
// Get the parent WindowContext of this WindowContext, taking the BFCache into
|
||||||
// account. This will not cross chrome/content <browser> boundaries.
|
// account. This will not cross chrome/content <browser> boundaries.
|
||||||
WindowContext* GetParentWindowContext();
|
WindowContext* GetParentWindowContext();
|
||||||
|
|||||||
@@ -3711,36 +3711,27 @@ nsresult Document::InitCSP(nsIChannel* aChannel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<dom::FeaturePolicy> Document::GetParentFeaturePolicy() {
|
already_AddRefed<dom::FeaturePolicy> Document::GetParentFeaturePolicy() {
|
||||||
if (!mDocumentContainer) {
|
BrowsingContext* browsingContext = GetBrowsingContext();
|
||||||
return nullptr;
|
NS_ENSURE_TRUE(browsingContext, nullptr);
|
||||||
|
NS_ENSURE_TRUE(browsingContext->IsContentSubframe(), nullptr);
|
||||||
|
|
||||||
|
HTMLIFrameElement* iframe =
|
||||||
|
HTMLIFrameElement::FromNodeOrNull(browsingContext->GetEmbedderElement());
|
||||||
|
if (iframe) {
|
||||||
|
return do_AddRef(iframe->FeaturePolicy());
|
||||||
}
|
}
|
||||||
|
|
||||||
nsPIDOMWindowOuter* containerWindow = mDocumentContainer->GetWindow();
|
if (XRE_IsParentProcess()) {
|
||||||
if (!containerWindow) {
|
return do_AddRef(browsingContext->Canonical()->GetContainerFeaturePolicy());
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BrowsingContext* context = containerWindow->GetBrowsingContext();
|
WindowContext* windowContext = browsingContext->GetCurrentWindowContext();
|
||||||
if (!context) {
|
NS_ENSURE_TRUE(windowContext, nullptr);
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
RefPtr<dom::FeaturePolicy> parentPolicy;
|
WindowGlobalChild* child = windowContext->GetWindowGlobalChild();
|
||||||
if (context->IsContentSubframe() && !context->GetParent()->IsInProcess()) {
|
NS_ENSURE_TRUE(child, nullptr);
|
||||||
// We are in cross process, so try to get feature policy from
|
|
||||||
// container's BrowsingContext
|
|
||||||
parentPolicy = context->GetFeaturePolicy();
|
|
||||||
return parentPolicy.forget();
|
|
||||||
}
|
|
||||||
|
|
||||||
nsCOMPtr<nsINode> node = containerWindow->GetFrameElementInternal();
|
return do_AddRef(child->GetContainerFeaturePolicy());
|
||||||
HTMLIFrameElement* iframe = HTMLIFrameElement::FromNodeOrNull(node);
|
|
||||||
if (!iframe) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
parentPolicy = iframe->FeaturePolicy();
|
|
||||||
return parentPolicy.forget();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult Document::InitFeaturePolicy(nsIChannel* aChannel) {
|
nsresult Document::InitFeaturePolicy(nsIChannel* aChannel) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "mozilla/dom/HTMLIFrameElement.h"
|
#include "mozilla/dom/HTMLIFrameElement.h"
|
||||||
|
#include "mozilla/dom/ContentChild.h"
|
||||||
#include "mozilla/dom/Document.h"
|
#include "mozilla/dom/Document.h"
|
||||||
#include "mozilla/dom/HTMLIFrameElementBinding.h"
|
#include "mozilla/dom/HTMLIFrameElementBinding.h"
|
||||||
#include "mozilla/dom/FeaturePolicy.h"
|
#include "mozilla/dom/FeaturePolicy.h"
|
||||||
@@ -234,24 +235,10 @@ void HTMLIFrameElement::MaybeStoreCrossOriginFeaturePolicy() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are in subframe cross origin, store the featurePolicy to
|
if (ContentChild* cc = ContentChild::GetSingleton()) {
|
||||||
// browsingContext
|
Unused << cc->SendSetContainerFeaturePolicy(browsingContext,
|
||||||
nsPIDOMWindowOuter* topWindow = browsingContext->Top()->GetDOMWindow();
|
mFeaturePolicy);
|
||||||
if (NS_WARN_IF(!topWindow)) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Document* topLevelDocument = topWindow->GetExtantDoc();
|
|
||||||
if (NS_WARN_IF(!topLevelDocument)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!NS_SUCCEEDED(nsContentUtils::CheckSameOrigin(topLevelDocument, this))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return value of setting synced field should be checked. See bug 1656492.
|
|
||||||
Unused << browsingContext->SetFeaturePolicy(mFeaturePolicy);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<nsIPrincipal>
|
already_AddRefed<nsIPrincipal>
|
||||||
|
|||||||
@@ -7310,6 +7310,19 @@ IPCResult ContentParent::RecvFOGData(ByteBuf&& buf) {
|
|||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mozilla::ipc::IPCResult ContentParent::RecvSetContainerFeaturePolicy(
|
||||||
|
const MaybeDiscardedBrowsingContext& aContainerContext,
|
||||||
|
FeaturePolicy* aContainerFeaturePolicy) {
|
||||||
|
if (aContainerContext.IsNullOrDiscarded()) {
|
||||||
|
return IPC_OK();
|
||||||
|
}
|
||||||
|
|
||||||
|
auto* context = aContainerContext.get_canonical();
|
||||||
|
context->SetContainerFeaturePolicy(aContainerFeaturePolicy);
|
||||||
|
|
||||||
|
return IPC_OK();
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP ContentParent::GetCanSend(bool* aCanSend) {
|
NS_IMETHODIMP ContentParent::GetCanSend(bool* aCanSend) {
|
||||||
*aCanSend = CanSend();
|
*aCanSend = CanSend();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|||||||
@@ -1411,6 +1411,10 @@ class ContentParent final
|
|||||||
|
|
||||||
mozilla::ipc::IPCResult RecvFOGData(ByteBuf&& buf);
|
mozilla::ipc::IPCResult RecvFOGData(ByteBuf&& buf);
|
||||||
|
|
||||||
|
mozilla::ipc::IPCResult RecvSetContainerFeaturePolicy(
|
||||||
|
const MaybeDiscardedBrowsingContext& aContainerContext,
|
||||||
|
FeaturePolicy* aContainerFeaturePolicy);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void SendGetFilesResponseAndForget(const nsID& aID,
|
void SendGetFilesResponseAndForget(const nsID& aID,
|
||||||
const GetFilesResponseResult& aResult);
|
const GetFilesResponseResult& aResult);
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ include "mozilla/GfxMessageUtils.h";
|
|||||||
include "mozilla/dom/BindingIPCUtils.h";
|
include "mozilla/dom/BindingIPCUtils.h";
|
||||||
include "mozilla/dom/CSPMessageUtils.h";
|
include "mozilla/dom/CSPMessageUtils.h";
|
||||||
include "mozilla/dom/DocShellMessageUtils.h";
|
include "mozilla/dom/DocShellMessageUtils.h";
|
||||||
|
include "mozilla/dom/FeaturePolicyUtils.h";
|
||||||
include "mozilla/dom/MediaSessionIPCUtils.h";
|
include "mozilla/dom/MediaSessionIPCUtils.h";
|
||||||
include "mozilla/dom/ReferrerInfoUtils.h";
|
include "mozilla/dom/ReferrerInfoUtils.h";
|
||||||
include "mozilla/ipc/ByteBufUtils.h";
|
include "mozilla/ipc/ByteBufUtils.h";
|
||||||
@@ -148,6 +149,7 @@ using struct mozilla::dom::LoadingSessionHistoryInfo from "mozilla/dom/SessionHi
|
|||||||
using mozilla::PDMFactory::MediaCodecsSupported from "PDMFactory.h";
|
using mozilla::PDMFactory::MediaCodecsSupported from "PDMFactory.h";
|
||||||
using mozilla::RemoteDecodeIn from "mozilla/RemoteDecoderManagerChild.h";
|
using mozilla::RemoteDecodeIn from "mozilla/RemoteDecoderManagerChild.h";
|
||||||
using mozilla::dom::PerformanceTimingData from "mozilla/dom/PerformanceTiming.h";
|
using mozilla::dom::PerformanceTimingData from "mozilla/dom/PerformanceTiming.h";
|
||||||
|
using refcounted mozilla::dom::FeaturePolicy from "mozilla/dom/FeaturePolicy.h";
|
||||||
|
|
||||||
union ChromeRegistryItem
|
union ChromeRegistryItem
|
||||||
{
|
{
|
||||||
@@ -1853,6 +1855,10 @@ child:
|
|||||||
// Tells the child to flush any pending data. Used in tests and ping
|
// Tells the child to flush any pending data. Used in tests and ping
|
||||||
// assembly. Buffer contains bincoded Rust structs.
|
// assembly. Buffer contains bincoded Rust structs.
|
||||||
async FlushFOGData() returns (ByteBuf buf);
|
async FlushFOGData() returns (ByteBuf buf);
|
||||||
|
|
||||||
|
parent:
|
||||||
|
async SetContainerFeaturePolicy(MaybeDiscardedBrowsingContext aContainerContext,
|
||||||
|
FeaturePolicy aContainerFeaturePolicy);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
include "mozilla/dom/DocShellMessageUtils.h";
|
include "mozilla/dom/DocShellMessageUtils.h";
|
||||||
|
include "mozilla/dom/FeaturePolicyUtils.h";
|
||||||
include "mozilla/dom/PermissionMessageUtils.h";
|
include "mozilla/dom/PermissionMessageUtils.h";
|
||||||
include "mozilla/ipc/TransportSecurityInfoUtils.h";
|
include "mozilla/ipc/TransportSecurityInfoUtils.h";
|
||||||
include "mozilla/ipc/URIUtils.h";
|
include "mozilla/ipc/URIUtils.h";
|
||||||
@@ -30,6 +31,7 @@ using mozilla::layers::LayersId from "mozilla/layers/LayersTypes.h";
|
|||||||
using refcounted class nsITransportSecurityInfo from "nsITransportSecurityInfo.h";
|
using refcounted class nsITransportSecurityInfo from "nsITransportSecurityInfo.h";
|
||||||
using mozilla::UseCounters from "mozilla/UseCounter.h";
|
using mozilla::UseCounters from "mozilla/UseCounter.h";
|
||||||
using mozilla::dom::MaybeDiscardedWindowContext from "mozilla/dom/WindowContext.h";
|
using mozilla::dom::MaybeDiscardedWindowContext from "mozilla/dom/WindowContext.h";
|
||||||
|
using refcounted mozilla::dom::FeaturePolicy from "mozilla/dom/FeaturePolicy.h";
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
@@ -86,6 +88,8 @@ child:
|
|||||||
*/
|
*/
|
||||||
async ResetScalingZoom();
|
async ResetScalingZoom();
|
||||||
|
|
||||||
|
async SetContainerFeaturePolicy(FeaturePolicy aContainerFeaturePolicy);
|
||||||
|
|
||||||
both:
|
both:
|
||||||
async RawMessage(JSActorMessageMeta aMetadata, ClonedMessageData? aData,
|
async RawMessage(JSActorMessageMeta aMetadata, ClonedMessageData? aData,
|
||||||
ClonedMessageData? aStack);
|
ClonedMessageData? aStack);
|
||||||
|
|||||||
@@ -554,6 +554,12 @@ mozilla::ipc::IPCResult WindowGlobalChild::RecvResetScalingZoom() {
|
|||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mozilla::ipc::IPCResult WindowGlobalChild::RecvSetContainerFeaturePolicy(
|
||||||
|
dom::FeaturePolicy* aContainerFeaturePolicy) {
|
||||||
|
mContainerFeaturePolicy = aContainerFeaturePolicy;
|
||||||
|
return IPC_OK();
|
||||||
|
}
|
||||||
|
|
||||||
IPCResult WindowGlobalChild::RecvRawMessage(
|
IPCResult WindowGlobalChild::RecvRawMessage(
|
||||||
const JSActorMessageMeta& aMeta, const Maybe<ClonedMessageData>& aData,
|
const JSActorMessageMeta& aMeta, const Maybe<ClonedMessageData>& aData,
|
||||||
const Maybe<ClonedMessageData>& aStack) {
|
const Maybe<ClonedMessageData>& aStack) {
|
||||||
@@ -680,7 +686,8 @@ void WindowGlobalChild::MaybeSendUpdateDocumentWouldPreloadResources() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(WindowGlobalChild, mWindowGlobal)
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(WindowGlobalChild, mWindowGlobal,
|
||||||
|
mContainerFeaturePolicy)
|
||||||
|
|
||||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(WindowGlobalChild)
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(WindowGlobalChild)
|
||||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ namespace mozilla {
|
|||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
class BrowsingContext;
|
class BrowsingContext;
|
||||||
|
class FeaturePolicy;
|
||||||
class WindowContext;
|
class WindowContext;
|
||||||
class WindowGlobalParent;
|
class WindowGlobalParent;
|
||||||
class JSWindowActorChild;
|
class JSWindowActorChild;
|
||||||
@@ -123,6 +124,10 @@ class WindowGlobalChild final : public WindowGlobalActor,
|
|||||||
|
|
||||||
void MaybeSendUpdateDocumentWouldPreloadResources();
|
void MaybeSendUpdateDocumentWouldPreloadResources();
|
||||||
|
|
||||||
|
dom::FeaturePolicy* GetContainerFeaturePolicy() const {
|
||||||
|
return mContainerFeaturePolicy;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const nsACString& GetRemoteType() override;
|
const nsACString& GetRemoteType() override;
|
||||||
|
|
||||||
@@ -164,6 +169,9 @@ class WindowGlobalChild final : public WindowGlobalActor,
|
|||||||
|
|
||||||
mozilla::ipc::IPCResult RecvResetScalingZoom();
|
mozilla::ipc::IPCResult RecvResetScalingZoom();
|
||||||
|
|
||||||
|
mozilla::ipc::IPCResult RecvSetContainerFeaturePolicy(
|
||||||
|
dom::FeaturePolicy* aContainerFeaturePolicy);
|
||||||
|
|
||||||
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -175,6 +183,7 @@ class WindowGlobalChild final : public WindowGlobalActor,
|
|||||||
RefPtr<nsGlobalWindowInner> mWindowGlobal;
|
RefPtr<nsGlobalWindowInner> mWindowGlobal;
|
||||||
RefPtr<dom::WindowContext> mWindowContext;
|
RefPtr<dom::WindowContext> mWindowContext;
|
||||||
nsCOMPtr<nsIPrincipal> mDocumentPrincipal;
|
nsCOMPtr<nsIPrincipal> mDocumentPrincipal;
|
||||||
|
RefPtr<dom::FeaturePolicy> mContainerFeaturePolicy;
|
||||||
nsCOMPtr<nsIURI> mDocumentURI;
|
nsCOMPtr<nsIURI> mDocumentURI;
|
||||||
int64_t mBeforeUnloadListeners = 0;
|
int64_t mBeforeUnloadListeners = 0;
|
||||||
bool mDocumentWouldPreloadResources = false;
|
bool mDocumentWouldPreloadResources = false;
|
||||||
|
|||||||
@@ -150,6 +150,9 @@ void WindowGlobalParent::Init() {
|
|||||||
if (!BrowsingContext()->IsDiscarded()) {
|
if (!BrowsingContext()->IsDiscarded()) {
|
||||||
MOZ_ALWAYS_SUCCEEDS(
|
MOZ_ALWAYS_SUCCEEDS(
|
||||||
BrowsingContext()->SetCurrentInnerWindowId(InnerWindowId()));
|
BrowsingContext()->SetCurrentInnerWindowId(InnerWindowId()));
|
||||||
|
|
||||||
|
Unused << SendSetContainerFeaturePolicy(
|
||||||
|
BrowsingContext()->GetContainerFeaturePolicy());
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
||||||
|
|||||||
Reference in New Issue
Block a user