Bug 1257862 - Allow running things from the delayed work queue during a nested event loop. r=khuey,dvander
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 01 Apr 2016 08:25:40 -0400
changeset 291236 f56afd13cb91786fbc21981687de46796a86f9e0
parent 291235 0e7aec22dfef3b8f6abd5f3f1a569643bd544800
child 291237 0b5162fbcf51354fc83ad92e01fb856994da55ac
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, dvander
bugs1257862
milestone48.0a1
Bug 1257862 - Allow running things from the delayed work queue during a nested event loop. r=khuey,dvander MozReview-Commit-ID: BmLM6j9yFEK
ipc/glue/MessagePump.cpp
--- a/ipc/glue/MessagePump.cpp
+++ b/ipc/glue/MessagePump.cpp
@@ -231,17 +231,20 @@ DoWorkRunnable::Run()
 }
 
 NS_IMETHODIMP
 DoWorkRunnable::Notify(nsITimer* aTimer)
 {
   MessageLoop* loop = MessageLoop::current();
   MOZ_ASSERT(loop);
 
+  bool nestableTasksAllowed = loop->NestableTasksAllowed();
+  loop->SetNestableTasksAllowed(true);
   mPump->DoDelayedWork(loop);
+  loop->SetNestableTasksAllowed(nestableTasksAllowed);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 DoWorkRunnable::Cancel()
 {
   // Workers require cancelable runnables, but we can't really cancel cleanly