Bug 965468 - Make LoadStartDetectionRunnable wait for loadstart. r=bent, a=lsblakk
authorTim Taubert <ttaubert@mozilla.com>
Wed, 29 Jan 2014 12:32:50 -0800
changeset 175195 981f79a18d83bdd10e4d579e98f8549edace273b
parent 175194 466a0f1b98cdca02a8f2fe00383ec32f29c33961
child 175196 a312fdd5d6878da95c199a2f15c3f8517656a0cb
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent, lsblakk
bugs965468
milestone28.0a2
Bug 965468 - Make LoadStartDetectionRunnable wait for loadstart. r=bent, a=lsblakk
dom/workers/XMLHttpRequest.cpp
--- a/dom/workers/XMLHttpRequest.cpp
+++ b/dom/workers/XMLHttpRequest.cpp
@@ -1423,17 +1423,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;
 }