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 291177 f56afd13cb91786fbc21981687de46796a86f9e0
parent 291176 0e7aec22dfef3b8f6abd5f3f1a569643bd544800
child 291178 0b5162fbcf51354fc83ad92e01fb856994da55ac
push id30130
push userkwierso@gmail.com
push dateFri, 01 Apr 2016 22:29:37 +0000
treeherdermozilla-central@b6ea6a3bb8a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, dvander
bugs1257862
milestone48.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 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