Bug 1648679 - Allow setting UseErrorPages from the parent process. r=nika

Differential Revision: https://phabricator.services.mozilla.com/D81484
This commit is contained in:
Matt Woodrow 2020-07-02 00:53:18 +00:00
Родитель 9356971435
Коммит ed35966cff
1 изменённых файлов: 4 добавлений и 6 удалений

Просмотреть файл

@ -341,6 +341,7 @@ already_AddRefed<BrowsingContext> BrowsingContext::CreateIndependent(
RefPtr<BrowsingContext> bc(
CreateDetached(nullptr, nullptr, EmptyString(), aType));
bc->mWindowless = bc->IsContent();
bc->mEmbeddedByThisProcess = true;
bc->EnsureAttached();
return bc.forget();
}
@ -2179,13 +2180,10 @@ bool BrowsingContext::CanSet(FieldIndex<IDX_PlatformOverride>,
}
bool BrowsingContext::CheckOnlyEmbedderCanSet(ContentParent* aSource) {
if (aSource) {
// Set by a content process, verify that it's this BC's embedder.
MOZ_ASSERT(XRE_IsParentProcess());
return Canonical()->IsEmbeddedInProcess(aSource->ChildID());
if (XRE_IsParentProcess()) {
uint64_t childId = aSource ? aSource->ChildID() : 0;
return Canonical()->IsEmbeddedInProcess(childId);
}
// In-process case, verify that we've been embedded in this process.
return mEmbeddedByThisProcess;
}