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

Unified Diff: content/browser/download/drag_download_file.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 | « chrome/test/base/ui_test_utils.cc ('k') | content/renderer/devtools_agent.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/drag_download_file.cc
diff --git a/content/browser/download/drag_download_file.cc b/content/browser/download/drag_download_file.cc
index cecb9be189225e4982ab684f237322a1fbe8aba9..c4bb898a511e1177443b7d952035aafe3deb2f10 100644
--- a/content/browser/download/drag_download_file.cc
+++ b/content/browser/download/drag_download_file.cc
@@ -223,11 +223,10 @@ void DragDownloadFile::AssertCurrentlyOnUIThread() {
void DragDownloadFile::StartNestedMessageLoop() {
AssertCurrentlyOnDragThread();
- bool old_state = MessageLoop::current()->NestableTasksAllowed();
- MessageLoop::current()->SetNestableTasksAllowed(true);
+ MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
is_running_nested_message_loop_ = true;
MessageLoop::current()->Run();
- MessageLoop::current()->SetNestableTasksAllowed(old_state);
+ DCHECK(!is_running_nested_message_loop_);
}
void DragDownloadFile::QuitNestedMessageLoop() {
« no previous file with comments | « chrome/test/base/ui_test_utils.cc ('k') | content/renderer/devtools_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698