mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 1559240 - Make sure oop-browser-context passes the BrowsingContext of the crashing subframe. r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D34930 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
43bd779652
commit
45db9df532
@ -2738,7 +2738,7 @@ bool nsFrameLoader::TryRemoteBrowser() {
|
|||||||
// Check if we should report a browser-crashed error because the browser
|
// Check if we should report a browser-crashed error because the browser
|
||||||
// failed to start.
|
// failed to start.
|
||||||
if (XRE_IsParentProcess() && mOwnerContent && mOwnerContent->IsXULElement()) {
|
if (XRE_IsParentProcess() && mOwnerContent && mOwnerContent->IsXULElement()) {
|
||||||
MaybeNotifyCrashed(nullptr);
|
MaybeNotifyCrashed(nullptr, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -3430,9 +3430,9 @@ nsresult nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool tabContextUpdated = aTabContext->SetTabContext(
|
bool tabContextUpdated =
|
||||||
OwnerIsMozBrowserFrame(), chromeOuterWindowID, showFocusRings, attrs,
|
aTabContext->SetTabContext(OwnerIsMozBrowserFrame(), chromeOuterWindowID,
|
||||||
presentationURLStr);
|
showFocusRings, attrs, presentationURLStr);
|
||||||
NS_ENSURE_STATE(tabContextUpdated);
|
NS_ENSURE_STATE(tabContextUpdated);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -3491,11 +3491,15 @@ void nsFrameLoader::SkipBrowsingContextDetach() {
|
|||||||
docshell->SkipBrowsingContextDetach();
|
docshell->SkipBrowsingContextDetach();
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsFrameLoader::MaybeNotifyCrashed(mozilla::ipc::MessageChannel* aChannel) {
|
void nsFrameLoader::MaybeNotifyCrashed(BrowsingContext* aBrowsingContext,
|
||||||
|
mozilla::ipc::MessageChannel* aChannel) {
|
||||||
if (mTabProcessCrashFired) {
|
if (mTabProcessCrashFired) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mBrowsingContext == aBrowsingContext) {
|
||||||
mTabProcessCrashFired = true;
|
mTabProcessCrashFired = true;
|
||||||
|
}
|
||||||
|
|
||||||
// Fire the crashed observer notification.
|
// Fire the crashed observer notification.
|
||||||
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
|
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
|
||||||
@ -3527,9 +3531,9 @@ void nsFrameLoader::MaybeNotifyCrashed(mozilla::ipc::MessageChannel* aChannel) {
|
|||||||
FrameCrashedEventInit init;
|
FrameCrashedEventInit init;
|
||||||
init.mBubbles = true;
|
init.mBubbles = true;
|
||||||
init.mCancelable = true;
|
init.mCancelable = true;
|
||||||
if (mBrowsingContext) {
|
if (aBrowsingContext) {
|
||||||
init.mBrowsingContextId = mBrowsingContext->Id();
|
init.mBrowsingContextId = aBrowsingContext->Id();
|
||||||
init.mIsTopFrame = !mBrowsingContext->GetParent();
|
init.mIsTopFrame = !aBrowsingContext->GetParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<FrameCrashedEvent> event = FrameCrashedEvent::Constructor(
|
RefPtr<FrameCrashedEvent> event = FrameCrashedEvent::Constructor(
|
||||||
|
@ -391,7 +391,8 @@ class nsFrameLoader final : public nsStubMutationObserver,
|
|||||||
|
|
||||||
void SkipBrowsingContextDetach();
|
void SkipBrowsingContextDetach();
|
||||||
|
|
||||||
void MaybeNotifyCrashed(mozilla::ipc::MessageChannel* aChannel);
|
void MaybeNotifyCrashed(mozilla::dom::BrowsingContext* aBrowsingContext,
|
||||||
|
mozilla::ipc::MessageChannel* aChannel);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsFrameLoader(mozilla::dom::Element* aOwner,
|
nsFrameLoader(mozilla::dom::Element* aOwner,
|
||||||
|
@ -683,7 +683,7 @@ void BrowserParent::ActorDestroy(ActorDestroyReason why) {
|
|||||||
|
|
||||||
// If this was a crash, tell our nsFrameLoader to fire crash events.
|
// If this was a crash, tell our nsFrameLoader to fire crash events.
|
||||||
if (why == AbnormalShutdown) {
|
if (why == AbnormalShutdown) {
|
||||||
frameLoader->MaybeNotifyCrashed(GetIPCChannel());
|
frameLoader->MaybeNotifyCrashed(mBrowsingContext, GetIPCChannel());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user