Bug 1356563 - Remove chrome-document-loaded observer only after handling it. r=me, a=gchang
authorJim Chen <nchen@mozilla.com>
Thu, 20 Apr 2017 13:47:00 -0400
changeset 396012 8dbf9446a94471fc1245bb4d625de7d751d13bd7
parent 396011 1b0848711aae256ccea76c427671b08c00376e1e
child 396013 a9bdcbca4218cac28516e3a0e5385ff5202143a3
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, gchang
bugs1356563
milestone54.0
Bug 1356563 - Remove chrome-document-loaded observer only after handling it. r=me, a=gchang Only remove the "chrome-document-loaded" observer after handling it in nsAppShell. Otherwise we may never end up handling it.
widget/android/nsAppShell.cpp
--- a/widget/android/nsAppShell.cpp
+++ b/widget/android/nsAppShell.cpp
@@ -594,18 +594,18 @@ nsAppShell::Observe(nsISupports* aSubjec
             widget->GetNativeData(NS_NATIVE_WIDGET) == widget) {
             if (jni::IsAvailable()) {
                 // When our first window has loaded, assume any JS
                 // initialization has run and set Gecko to ready.
                 java::GeckoThread::CheckAndSetState(
                         java::GeckoThread::State::PROFILE_READY(),
                         java::GeckoThread::State::RUNNING());
             }
+            removeObserver = true;
         }
-        removeObserver = true;
 
     } else if (!strcmp(aTopic, "quit-application-granted")) {
         if (jni::IsAvailable()) {
             java::GeckoThread::SetState(
                     java::GeckoThread::State::EXITING());
 
             // We are told explicitly to quit, perhaps due to
             // nsIAppStartup::Quit being called. We should release our hold on