Backout e601c1693713 (bug 784792) pending approval; a=backout DONTBUILD
authorEd Morley <emorley@mozilla.com>
Mon, 15 Oct 2012 21:15:22 +0100
changeset 109548 903136287770f6e9b59ff64895492826209aedab
parent 109547 560475ed1f92d801f03bd41ee1abc88cd268cdcf
child 109549 3c067c8fb7fd522fe5e7fcb0070973169be53e06
push id1529
push useremorley@mozilla.com
push dateMon, 15 Oct 2012 20:15:44 +0000
treeherdermozilla-beta@903136287770 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs784792
milestone17.0
backs oute601c1693713040b4cd1bf2409e08d179a2ee47d
Backout e601c1693713 (bug 784792) pending approval; a=backout DONTBUILD
dom/base/nsDOMClassInfo.cpp
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -2074,18 +2074,21 @@ WrapNativeParent(JSContext *cx, JSObject
 static inline nsresult
 SetParentToWindow(nsGlobalWindow *win, JSObject **parent)
 {
   MOZ_ASSERT(win);
   MOZ_ASSERT(win->IsInnerWindow());
   *parent = win->FastGetGlobalJSObject();
 
   if (MOZ_UNLIKELY(!*parent)) {
-    // The inner window has been torn down. The scope is dying, so don't create
-    // any new wrappers.
+    // The only known case where this can happen is when the inner window has
+    // been torn down. See bug 691178 comment 11. Should be a fatal MOZ_ASSERT,
+    // but we've found a way to hit it too often in mochitests. See bugs 777875
+    // 778424, 781078.
+    NS_ASSERTION(win->IsClosedOrClosing(), "win should be closed or closing");
     return NS_ERROR_FAILURE;
   }
   return NS_OK;
 }
 
 // static
 
 nsISupports *