зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1634596 - Avoid switching into a new process if an ancestor is discarded, r=farre
This is a temporary workaround for the crashes this can cause. A more thorough fix to discarded ancestor issues will be implemented in bug 1634759. Differential Revision: https://phabricator.services.mozilla.com/D74101
This commit is contained in:
Родитель
9f954bebdb
Коммит
5b5f1a77c5
|
@ -37,6 +37,23 @@ nsresult BrowserBridgeParent::InitWithProcess(
|
||||||
RefPtr<CanonicalBrowsingContext> browsingContext =
|
RefPtr<CanonicalBrowsingContext> browsingContext =
|
||||||
aWindowInit.browsingContext().get_canonical();
|
aWindowInit.browsingContext().get_canonical();
|
||||||
|
|
||||||
|
// Unfortunately, due to the current racy destruction of BrowsingContext
|
||||||
|
// instances when Fission is enabled, while `browsingContext` may not be
|
||||||
|
// discarded, an ancestor might be.
|
||||||
|
//
|
||||||
|
// A discarded ancestor will cause us issues when creating our `BrowserParent`
|
||||||
|
// in the new content process, so abort the attempt if we have one.
|
||||||
|
//
|
||||||
|
// FIXME: We should never have a non-discarded BrowsingContext with discarded
|
||||||
|
// ancestors. (bug 1634759)
|
||||||
|
CanonicalBrowsingContext* ancestor = browsingContext->GetParent();
|
||||||
|
while (ancestor) {
|
||||||
|
if (NS_WARN_IF(ancestor->IsDiscarded())) {
|
||||||
|
return NS_ERROR_UNEXPECTED;
|
||||||
|
}
|
||||||
|
ancestor = ancestor->GetParent();
|
||||||
|
}
|
||||||
|
|
||||||
MutableTabContext tabContext;
|
MutableTabContext tabContext;
|
||||||
tabContext.SetTabContext(Manager()->ChromeOuterWindowID(),
|
tabContext.SetTabContext(Manager()->ChromeOuterWindowID(),
|
||||||
Manager()->ShowFocusRings(), aPresentationURL,
|
Manager()->ShowFocusRings(), aPresentationURL,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче