Bug 1507168 - Only assert if window isn't being torn down. r=peterv
authorAndreas Farre <farre@mozilla.com>
Mon, 19 Nov 2018 15:59:04 +0000
changeset 447005 17edafa646aef9ba5f1bb13d5dbff7cba3145700
parent 447004 655a4ddc4212cfcbc835dca5d643af7309573c39
child 447006 87037e14247bbd23e32dd9084262b5aabe9bbf8d
push id35065
push userrmaries@mozilla.com
push dateMon, 19 Nov 2018 21:56:32 +0000
treeherdermozilla-central@bd4cebdbed4b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1507168
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1507168 - Only assert if window isn't being torn down. r=peterv Differential Revision: https://phabricator.services.mozilla.com/D12258
dom/base/nsGlobalWindowOuter.cpp
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -2246,18 +2246,19 @@ nsGlobalWindowOuter::DetachFromDocShell(
 
 void
 nsGlobalWindowOuter::SetOpenerWindow(nsPIDOMWindowOuter* aOpener,
                                      bool aOriginalOpener)
 {
   nsWeakPtr opener = do_GetWeakReference(aOpener);
   if (opener == mOpener) {
     MOZ_DIAGNOSTIC_ASSERT(
-      !aOpener || (GetBrowsingContext() && GetBrowsingContext()->GetOpener() ==
-                                             aOpener->GetBrowsingContext()));
+      !aOpener || !aOpener->GetDocShell() ||
+      (GetBrowsingContext() &&
+       GetBrowsingContext()->GetOpener() == aOpener->GetBrowsingContext()));
     return;
   }
 
   NS_ASSERTION(!aOriginalOpener || !mSetOpenerWindowCalled,
                "aOriginalOpener is true, but not first call to "
                "SetOpenerWindow!");
   NS_ASSERTION(aOpener || !aOriginalOpener,
                "Shouldn't set mHadOriginalOpener if aOpener is null");