Bug 1527978, bring back the old behavior of worker's postMessage spam limit, r=baku
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Thu, 14 Feb 2019 20:48:11 +0200
changeset 459564 eb06f238c16ad19a2085cad55136eeba2667f9ee
parent 459563 4414af4d7368360eaee6f416e04e8e444b7a727d
child 459565 4739353088fcad81bc126deab56e8de0fad7a88a
push id111969
push useropettay@mozilla.com
push dateFri, 15 Feb 2019 20:30:02 +0000
treeherdermozilla-inbound@eb06f238c16a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1527978
milestone67.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 1527978, bring back the old behavior of worker's postMessage spam limit, r=baku
dom/workers/WorkerPrivate.cpp
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -2698,17 +2698,18 @@ void WorkerPrivate::DoRunLoop(JSContext*
     }
 
     // If the worker thread is spamming the main thread faster than it can
     // process the work, then pause the worker thread until the main thread
     // catches up.
     size_t queuedEvents = mMainThreadEventTarget->Length() +
                           mMainThreadDebuggeeEventTarget->Length();
     if (queuedEvents > 5000) {
-      mMainThreadEventTarget->AwaitIdle();
+      // Note, postMessage uses mMainThreadDebuggeeEventTarget!
+      mMainThreadDebuggeeEventTarget->AwaitIdle();
     }
   }
 
   MOZ_CRASH("Shouldn't get here!");
 }
 
 void WorkerPrivate::OnProcessNextEvent() {
   AssertIsOnWorkerThread();