Bug 1361709 - Move FlushPendingLinkUpdatesFromRunnable to idle dispatch; r=smaug
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 27 May 2017 22:13:24 -0400
changeset 586208 acca723541c25889cad344f19087983c9d31fa1b
parent 586207 2cba4fc3c88a70702bddfaffb10863e10c36d407
child 586209 33f6f0354aded142e7a41d5a6209d0d95c4c7521
child 589068 d0efe4c8cfbf8abc5be5bfaba762497dc5eb17ea
child 589069 b8931e5ea12b7143baae3e9937370231f6169a7a
child 589790 0c3fe094fdf5c862aec05ddeb35a26eab71b2d52
push id61331
push userbmo:cpearce@mozilla.com
push dateMon, 29 May 2017 23:54:26 +0000
reviewerssmaug
bugs1361709
milestone55.0a1
Bug 1361709 - Move FlushPendingLinkUpdatesFromRunnable to idle dispatch; r=smaug
dom/base/nsDocument.cpp
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -10005,19 +10005,19 @@ nsIDocument::RegisterPendingLinkUpdate(L
     return;
   }
 
   aLink->SetHasPendingLinkUpdate();
 
   if (!mHasLinksToUpdateRunnable) {
     nsCOMPtr<nsIRunnable> event =
       NewRunnableMethod(this, &nsIDocument::FlushPendingLinkUpdatesFromRunnable);
+    // Do this work in a second in the worst case.
     nsresult rv =
-      Dispatch("nsIDocument::FlushPendingLinkUpdatesFromRunnable",
-               TaskCategory::Other, event.forget());
+      NS_IdleDispatchToCurrentThread(event.forget(), 1000);
     if (NS_FAILED(rv)) {
       // If during shutdown posting a runnable doesn't succeed, we probably
       // don't need to update link states.
       return;
     }
     mHasLinksToUpdateRunnable = true;
   }