Backed out changeset f74c9d255293 (bug 1568055) for Assertion failures (MOZ_ASSERT_UNREACHABLE: leaking stream event). CLOSED TREE

This commit is contained in:
Narcis Beleuzu 2019-07-23 23:13:43 +03:00
parent 5f131d63bd
commit 78f3381905
2 changed files with 6 additions and 16 deletions

View File

@ -324,20 +324,16 @@ static already_AddRefed<BrowsingContext> CreateBrowsingContext(
nsAutoString frameName;
GetFrameName(aOwner, frameName);
RefPtr<BrowsingContext> browsingContext;
if (IsTopContent(parentContext, aOwner)) {
// Create toplevel content without a parent & as Type::Content.
browsingContext = BrowsingContext::Create(nullptr, aOpener, frameName,
BrowsingContext::Type::Content);
} else {
auto type = parentContext->IsContent() ? BrowsingContext::Type::Content
: BrowsingContext::Type::Chrome;
browsingContext =
BrowsingContext::Create(parentContext, aOpener, frameName, type);
return BrowsingContext::Create(nullptr, aOpener, frameName,
BrowsingContext::Type::Content);
}
browsingContext->SetEmbedderElement(aOwner);
return browsingContext.forget();
auto type = parentContext->IsContent() ? BrowsingContext::Type::Content
: BrowsingContext::Type::Chrome;
return BrowsingContext::Create(parentContext, aOpener, frameName, type);
}
nsFrameLoader* nsFrameLoader::Create(Element* aOwner, BrowsingContext* aOpener,

View File

@ -88,12 +88,6 @@ void WindowGlobalParent::Init(const WindowGlobalInit& aInit) {
mBrowsingContext = CanonicalBrowsingContext::Cast(aInit.browsingContext());
MOZ_ASSERT(mBrowsingContext);
MOZ_DIAGNOSTIC_ASSERT(
!mBrowsingContext->GetParent() ||
mBrowsingContext->GetEmbedderWindowGlobal(),
"When creating a non-root WindowGlobalParent, the WindowGlobalParent "
"for our embedder should've already been created.");
// Attach ourself to the browsing context.
mBrowsingContext->RegisterWindowGlobal(this);