Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: ipc/ipc_sync_channel.cc

Issue 9384024: Prefer ScopedNestableTaskAllower over manual save/restore (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename back to "allow". Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/devtools_agent.cc ('k') | net/base/file_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_sync_channel.cc
diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc
index 74d9744b17c14c8a6e794d974f24f3feba0bd093..be8315cdcda8cbf39db265e89559df3eae5dbc85 100644
--- a/ipc/ipc_sync_channel.cc
+++ b/ipc/ipc_sync_channel.cc
@@ -506,11 +506,11 @@ void SyncChannel::WaitForReplyWithNestedMessageLoop(SyncContext* context) {
sync_msg_queue->set_top_send_done_watcher(&send_done_watcher);
send_done_watcher.StartWatching(context->GetSendDoneEvent(), context);
- bool old_state = MessageLoop::current()->NestableTasksAllowed();
- MessageLoop::current()->SetNestableTasksAllowed(true);
- MessageLoop::current()->Run();
- MessageLoop::current()->SetNestableTasksAllowed(old_state);
+ {
+ MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
+ MessageLoop::current()->Run();
+ }
sync_msg_queue->set_top_send_done_watcher(old_send_done_event_watcher);
if (old_send_done_event_watcher && old_event) {
« no previous file with comments | « content/renderer/devtools_agent.cc ('k') | net/base/file_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698