Bug 1621192 - P1: Move allowPlugins to BrowsingContext. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D66167
This commit is contained in:
@@ -241,6 +241,9 @@ already_AddRefed<BrowsingContext> BrowsingContext::CreateDetached(
|
||||
|
||||
context->mFields.SetWithoutSyncing<IDX_IsActive>(true);
|
||||
|
||||
const bool allowPlugins = inherit ? inherit->GetAllowPlugins() : true;
|
||||
context->mFields.SetWithoutSyncing<IDX_AllowPlugins>(allowPlugins);
|
||||
|
||||
return context.forget();
|
||||
}
|
||||
|
||||
@@ -1420,13 +1423,7 @@ void BrowsingContext::DidSet(FieldIndex<IDX_UserAgentOverride>) {
|
||||
});
|
||||
}
|
||||
|
||||
bool BrowsingContext::CanSet(FieldIndex<IDX_UserAgentOverride>,
|
||||
const nsString& aUserAgent,
|
||||
ContentParent* aSource) {
|
||||
if (!IsTop()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BrowsingContext::CheckOnlyOwningProcessCanSet(ContentParent* aSource) {
|
||||
if (aSource) {
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
|
||||
@@ -1444,6 +1441,22 @@ bool BrowsingContext::CanSet(FieldIndex<IDX_UserAgentOverride>,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BrowsingContext::CanSet(FieldIndex<IDX_AllowPlugins>,
|
||||
const bool& aAllowPlugins,
|
||||
ContentParent* aSource) {
|
||||
return CheckOnlyOwningProcessCanSet(aSource);
|
||||
}
|
||||
|
||||
bool BrowsingContext::CanSet(FieldIndex<IDX_UserAgentOverride>,
|
||||
const nsString& aUserAgent,
|
||||
ContentParent* aSource) {
|
||||
if (!IsTop()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return CheckOnlyOwningProcessCanSet(aSource);
|
||||
}
|
||||
|
||||
bool BrowsingContext::CheckOnlyEmbedderCanSet(ContentParent* aSource) {
|
||||
if (aSource) {
|
||||
// Set by a content process, verify that it's this BC's embedder.
|
||||
|
||||
Reference in New Issue
Block a user