Bug 965468 - Make LoadStartDetectionRunnable wait for loadstart r=bent
authorTim Taubert <ttaubert@mozilla.com>
Wed, 29 Jan 2014 12:32:50 -0800
changeset 181935 acdd3135860fe5908d0aa3dd22985d2c5328dfa7
parent 181934 f99313fc00b5823ce92ba4671727c7209d692389
child 181936 4e40f5a0bd940e2b049206f194344d050b4e8bce
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs965468
milestone29.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 965468 - Make LoadStartDetectionRunnable wait for loadstart r=bent
dom/workers/XMLHttpRequest.cpp
--- a/dom/workers/XMLHttpRequest.cpp
+++ b/dom/workers/XMLHttpRequest.cpp
@@ -1065,17 +1065,17 @@ Proxy::HandleEvent(nsIDOMEvent* aEvent)
       mMainThreadSeenLoadStart = true;
     }
     else if (mMainThreadSeenLoadStart &&
              type.EqualsASCII(sEventStrings[STRING_loadend])) {
       mMainThreadSeenLoadStart = false;
 
       nsRefPtr<LoadStartDetectionRunnable> runnable =
         new LoadStartDetectionRunnable(this, mXMLHttpRequestPrivate);
-      if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
+      if (!runnable->RegisterAndDispatch()) {
         NS_WARNING("Failed to dispatch LoadStartDetectionRunnable!");
       }
     }
   }
 
   return NS_OK;
 }