From 15090e7a5cfe163b05cb0142dd755c13c879810b Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Thu, 21 Apr 2016 14:14:45 -0700 Subject: [PATCH] Bug 1266178 Make ServiceWorkerClient not assert if the document doesn't have an outer window. r=ehsan --- dom/workers/ServiceWorkerClient.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dom/workers/ServiceWorkerClient.cpp b/dom/workers/ServiceWorkerClient.cpp index f4f6958b6970..cb101513de6b 100644 --- a/dom/workers/ServiceWorkerClient.cpp +++ b/dom/workers/ServiceWorkerClient.cpp @@ -35,6 +35,7 @@ NS_INTERFACE_MAP_END ServiceWorkerClientInfo::ServiceWorkerClientInfo(nsIDocument* aDoc) : mWindowId(0) + , mFrameType(FrameType::None) { MOZ_ASSERT(aDoc); nsresult rv = aDoc->GetOrCreateId(mClientId); @@ -64,8 +65,9 @@ ServiceWorkerClientInfo::ServiceWorkerClientInfo(nsIDocument* aDoc) } RefPtr outerWindow = nsGlobalWindow::Cast(aDoc->GetWindow()); - MOZ_ASSERT(outerWindow); - if (!outerWindow->IsTopLevelWindow()) { + if (!outerWindow) { + MOZ_ASSERT(mFrameType == FrameType::None); + } else if (!outerWindow->IsTopLevelWindow()) { mFrameType = FrameType::Nested; } else if (outerWindow->HadOriginalOpener()) { mFrameType = FrameType::Auxiliary;