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

Unified Diff: webkit/support/webkit_support.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
Index: webkit/support/webkit_support.cc
diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc
index 8c312efc8463734adda27ed0c381ae2297eb8e4e..db6be264e7033ad6a584ce0eaa71c692784fac24 100644
--- a/webkit/support/webkit_support.cc
+++ b/webkit/support/webkit_support.cc
@@ -213,10 +213,8 @@ class WebKitClientMessageLoopImpl
message_loop_ = NULL;
}
virtual void run() {
- bool old_state = message_loop_->NestableTasksAllowed();
- message_loop_->SetNestableTasksAllowed(true);
+ MessageLoop::ScopedNestableTaskAllower allow(message_loop_);
message_loop_->Run();
- message_loop_->SetNestableTasksAllowed(old_state);
}
virtual void quitNow() {
message_loop_->QuitNow();
@@ -450,10 +448,8 @@ void MessageLoopSetNestableTasksAllowed(bool allowed) {
void DispatchMessageLoop() {
MessageLoop* current = MessageLoop::current();
- bool old_state = current->NestableTasksAllowed();
- current->SetNestableTasksAllowed(true);
+ MessageLoop::ScopedNestableTaskAllower allow(current);
current->RunAllPending();
- current->SetNestableTasksAllowed(old_state);
}
WebDevToolsAgentClient::WebKitClientMessageLoop* CreateDevToolsMessageLoop() {
« no previous file with comments | « webkit/plugins/ppapi/ppb_flash_message_loop_impl.cc ('k') | webkit/tools/test_shell/test_shell_devtools_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698