Backed out changeset b030bb382b31 (bug 1051995) for m-oth bustage
authorWes Kocher <wkocher@mozilla.com>
Thu, 18 Sep 2014 17:07:56 -0700
changeset 206105 b7088613e4c71839f088c4705e54efa12f2f9bba
parent 206104 7f71741cbb34da596a6b96e32a4ffdf06d3b88bd
child 206106 ba79aa341f3424cc69fb6b6ff39c2cd869ad3d9e
push id27512
push usercbook@mozilla.com
push dateFri, 19 Sep 2014 12:07:02 +0000
treeherdermozilla-central@c8dee1c9cc3d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1051995
milestone35.0a1
backs outb030bb382b31903cbf8d20e2f598b414c6daaeca
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
Backed out changeset b030bb382b31 (bug 1051995) for m-oth bustage
dom/browser-element/BrowserElementParent.jsm
dom/ipc/TabParent.cpp
--- a/dom/browser-element/BrowserElementParent.jsm
+++ b/dom/browser-element/BrowserElementParent.jsm
@@ -170,17 +170,17 @@ function BrowserElementParent(frameLoade
   }
 
   this._doCommandHandlerBinder = this._doCommandHandler.bind(this);
   this._frameElement.addEventListener('mozdocommand',
                                       this._doCommandHandlerBinder,
                                       /* useCapture = */ false,
                                       /* wantsUntrusted = */ false);
 
-  Services.obs.addObserver(this, 'ipc:browser-destroyed', /* ownsWeak = */ false);
+  Services.obs.addObserver(this, 'ipc:browser-destroyed', /* ownsWeak = */ true);
 
   this._window._browserElementParents.set(this, null);
 
   // Insert ourself into the prompt service.
   BrowserElementPromptService.mapFrameToBrowserElementParent(this._frameElement, this);
   if (!isPendingFrame) {
     this._setupMessageListener();
     this._registerAppManifest();
@@ -914,29 +914,28 @@ BrowserElementParent.prototype = {
     case 'ask-children-to-exit-fullscreen':
       if (this._isAlive() &&
           this._frameElement.ownerDocument == subject &&
           this._hasRemoteFrame) {
         this._sendAsyncMsg('exit-fullscreen');
       }
       break;
     case 'remote-browser-frame-shown':
-      // XXXkhuey why don't we check _isAlive() here?
       if (this._frameLoader == subject) {
         if (!this._mm) {
           this._setupMessageListener();
           this._registerAppManifest();
         }
         Services.obs.removeObserver(this, 'remote-browser-frame-shown');
       }
     case 'ipc:browser-destroyed':
-      if (this._isAlive() && subject == this._frameLoader.tabParent) {
+      if (this._isAlive() && subject == this._frameLoader) {
         Services.obs.removeObserver(this, 'ipc:browser-destroyed');
         this._frameElement.removeEventListener('mozdocommand',
-                                               this._doCommandHandlerBinder);
+                                               this._doCommandHandlerBinder)
       }
       break;
     default:
       debug('Unknown topic: ' + topic);
       break;
     };
   },
 };
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -333,39 +333,38 @@ void
 TabParent::ActorDestroy(ActorDestroyReason why)
 {
   if (sEventCapturer == this) {
     sEventCapturer = nullptr;
   }
   if (mIMETabParent == this) {
     mIMETabParent = nullptr;
   }
-
+  nsRefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
   nsCOMPtr<nsIObserverService> os = services::GetObserverService();
-  MOZ_ASSERT(os);
-  os->NotifyObservers(NS_ISUPPORTS_CAST(nsITabParent*, this), "ipc:browser-destroyed", nullptr);
-
-  nsRefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
   nsRefPtr<nsFrameMessageManager> fmm;
   if (frameLoader) {
     fmm = frameLoader->GetFrameMessageManager();
     nsCOMPtr<Element> frameElement(mFrameElement);
     ReceiveMessage(CHILD_PROCESS_SHUTDOWN_MESSAGE, false, nullptr, nullptr,
                    nullptr);
     frameLoader->DestroyChild();
 
-    if (why == AbnormalShutdown) {
+    if (why == AbnormalShutdown && os) {
       os->NotifyObservers(NS_ISUPPORTS_CAST(nsIFrameLoader*, frameLoader),
                           "oop-frameloader-crashed", nullptr);
       nsContentUtils::DispatchTrustedEvent(frameElement->OwnerDoc(), frameElement,
                                            NS_LITERAL_STRING("oop-browser-crashed"),
                                            true, true);
     }
   }
 
+  if (os) {
+    os->NotifyObservers(NS_ISUPPORTS_CAST(nsITabParent*, this), "ipc:browser-destroyed", nullptr);
+  }
   if (fmm) {
     fmm->Disconnect();
   }
 }
 
 bool
 TabParent::RecvMoveFocus(const bool& aForward)
 {