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

Unified Diff: base/message_loop.h

Issue 9384024: Prefer ScopedNestableTaskAllower over manual save/restore (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « no previous file | base/message_loop_unittest.cc » ('j') | chrome/browser/automation/automation_provider_win.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop.h
diff --git a/base/message_loop.h b/base/message_loop.h
index e14baa7b54d3846f80efb915996d2c03812b1fd2..bbd0d68709445973887db3cfb4d78003eb75002e 100644
--- a/base/message_loop.h
+++ b/base/message_loop.h
@@ -67,11 +67,11 @@ class Histogram;
// (DoDragDrop), printer functions (StartDoc) and *many* others.
//
// Sample workaround when inner task processing is needed:
-// bool old_state = MessageLoop::current()->NestableTasksAllowed();
-// MessageLoop::current()->SetNestableTasksAllowed(true);
-// HRESULT hr = DoDragDrop(...); // Implicitly runs a modal message loop here.
-// MessageLoop::current()->SetNestableTasksAllowed(old_state);
-// // Process hr (the result returned by DoDragDrop().
+// {
+// MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
+// HRESULT hr = DoDragDrop(...); // Implicitly runs a modal message loop.
+// }
+// // Process |hr| (the result returned by DoDragDrop()).
Ryan Sleevi 2012/02/11 02:17:22 Comment bug: |hr| is now out of scope once outside
dhollowa 2012/02/13 17:44:26 Done.
//
// Please be SURE your task is reentrant (nestable) and all global variables
// are stable and accessible before calling SetNestableTasksAllowed(true).
« no previous file with comments | « no previous file | base/message_loop_unittest.cc » ('j') | chrome/browser/automation/automation_provider_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698