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

Unified Diff: chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc

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
Index: chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc
diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc
index 795b9672025fc6e732cb8569ec8ba41209a52fd3..ab1a843353de93e1ba10d887708f4f71f27d5350 100644
--- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc
+++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc
@@ -211,11 +211,12 @@ void NativeTabContentsViewAura::StartDragging(const WebDropData& drop_data,
// We need to enable recursive tasks on the message loop so we can get
// updates while in the system DoDragDrop loop.
- bool old_state = MessageLoop::current()->NestableTasksAllowed();
- MessageLoop::current()->SetNestableTasksAllowed(true);
- int result_op = aura::client::GetDragDropClient()->StartDragAndDrop(
- data, ConvertFromWeb(ops));
- MessageLoop::current()->SetNestableTasksAllowed(old_state);
+ int result_op = 0;
+ {
+ MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
+ result_op = aura::client::GetDragDropClient()->StartDragAndDrop(
jar (doing other things) 2012/02/11 03:24:38 nit: Does this actually induce a nested message lo
dhollowa 2012/02/13 17:44:26 sky will be the best person to comment here. But
jar (doing other things) 2012/02/14 01:51:43 Sky@ Do you think this is as close as you can get
sky 2012/02/14 04:45:05 DragDropController::StartDragAndDrop is closer (in
dhollowa 2012/02/14 05:42:20 Shall I move the scoper there then? Or would you
+ data, ConvertFromWeb(ops));
+ }
EndDrag(ConvertToWeb(result_op));
GetWebContents()->GetRenderViewHost()->DragSourceSystemDragEnded();

Powered by Google App Engine
This is Rietveld 408576698