Bug 1376981 - Label nsBindingManager::PostProcessAttachedQueueEvent (r=smaug)
authorBill McCloskey <billm@mozilla.com>
Wed, 14 Jun 2017 14:24:59 -0700
changeset 418310 b5ca3d02cd729033daa00a858c01ba0e0339c89e
parent 418309 4f1682b09cd61d9d7982846c4c25c6d8be13420e
child 418311 c803c00aed9b499dc54697ca7cfd26b784400ea7
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1376981
milestone56.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 1376981 - Label nsBindingManager::PostProcessAttachedQueueEvent (r=smaug) MozReview-Commit-ID: G0xxNwtXsex
dom/xbl/nsBindingManager.cpp
--- a/dom/xbl/nsBindingManager.cpp
+++ b/dom/xbl/nsBindingManager.cpp
@@ -346,21 +346,25 @@ nsBindingManager::AddToAttachedQueue(nsX
 
   return NS_OK;
 
 }
 
 void
 nsBindingManager::PostProcessAttachedQueueEvent()
 {
+  MOZ_ASSERT(NS_IsMainThread());
+  if (!mDocument) {
+    return;
+  }
   mProcessAttachedQueueEvent =
     NewRunnableMethod("nsBindingManager::DoProcessAttachedQueue",
                       this, &nsBindingManager::DoProcessAttachedQueue);
-  nsresult rv = NS_DispatchToCurrentThread(mProcessAttachedQueueEvent);
-  if (NS_SUCCEEDED(rv) && mDocument) {
+  nsresult rv = mDocument->EventTargetFor(TaskCategory::Other)->Dispatch(do_AddRef(mProcessAttachedQueueEvent));
+  if (NS_SUCCEEDED(rv)) {
     mDocument->BlockOnload();
   }
 }
 
 // static
 void
 nsBindingManager::PostPAQEventCallback(nsITimer* aTimer, void* aClosure)
 {