mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 17:25:36 +00:00
Bug 1595936: Part 3b - Don't force FrameLoader initialization on removal. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D55875 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
e92365dba5
commit
b0061d264f
@ -1949,7 +1949,7 @@ void nsFrameLoader::SetOwnerContent(Element* aContent) {
|
||||
}
|
||||
mOwnerContent = aContent;
|
||||
|
||||
if (RefPtr<BrowsingContext> browsingContext = GetBrowsingContext()) {
|
||||
if (RefPtr<BrowsingContext> browsingContext = GetExtantBrowsingContext()) {
|
||||
browsingContext->SetEmbedderElement(mOwnerContent);
|
||||
}
|
||||
|
||||
@ -3198,12 +3198,22 @@ already_AddRefed<nsILoadContext> nsFrameLoader::LoadContext() {
|
||||
|
||||
already_AddRefed<BrowsingContext> nsFrameLoader::GetBrowsingContext() {
|
||||
RefPtr<BrowsingContext> browsingContext;
|
||||
if (IsRemoteFrame() && EnsureRemoteBrowser()) {
|
||||
browsingContext = mRemoteBrowser->GetBrowsingContext();
|
||||
} else if (GetDocShell(IgnoreErrors())) {
|
||||
browsingContext = GetDocShell()->GetBrowsingContext();
|
||||
if (IsRemoteFrame()) {
|
||||
Unused << EnsureRemoteBrowser();
|
||||
} else if (mOwnerContent) {
|
||||
Unused << MaybeCreateDocShell();
|
||||
}
|
||||
return browsingContext.forget();
|
||||
return GetExtantBrowsingContext();
|
||||
}
|
||||
|
||||
already_AddRefed<BrowsingContext> nsFrameLoader::GetExtantBrowsingContext() {
|
||||
if (mRemoteBrowser) {
|
||||
return do_AddRef(mRemoteBrowser->GetBrowsingContext());
|
||||
}
|
||||
if (mDocShell) {
|
||||
return do_AddRef(mDocShell->GetBrowsingContext());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void nsFrameLoader::InitializeBrowserAPI() {
|
||||
|
@ -153,6 +153,7 @@ class nsFrameLoader final : public nsStubMutationObserver,
|
||||
already_AddRefed<nsILoadContext> LoadContext();
|
||||
|
||||
already_AddRefed<mozilla::dom::BrowsingContext> GetBrowsingContext();
|
||||
already_AddRefed<mozilla::dom::BrowsingContext> GetExtantBrowsingContext();
|
||||
|
||||
/**
|
||||
* Start loading the frame. This method figures out what to load
|
||||
|
Loading…
Reference in New Issue
Block a user