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

Unified Diff: ash/drag_drop/drag_drop_controller.cc

Issue 1640503002: ash: Do not use MessageLoopForUI when not needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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: ash/drag_drop/drag_drop_controller.cc
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc
index ad87b7c59a8a7200af6449a8d653fedbc878801f..1ec53aaca33114af10dfaccd752d511f0891db47 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -13,6 +13,7 @@
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram_macros.h"
#include "base/run_loop.h"
+#include "base/thread_task_runner_handle.h"
#include "ui/aura/client/capture_client.h"
#include "ui/aura/env.h"
#include "ui/aura/window.h"
@@ -222,7 +223,7 @@ int DragDropController::StartDragAndDrop(
if (should_block_during_drag_drop_) {
base::RunLoop run_loop;
quit_closure_ = run_loop.QuitClosure();
- base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
+ base::MessageLoop* loop = base::MessageLoop::current();
base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop);
run_loop.Run();
}
@@ -501,10 +502,9 @@ void DragDropController::AnimationEnded(const gfx::Animation* animation) {
ForwardPendingLongTap();
} else {
// See comment about this in OnGestureEvent().
- base::MessageLoopForUI::current()->PostTask(
- FROM_HERE,
- base::Bind(&DragDropController::ForwardPendingLongTap,
- weak_factory_.GetWeakPtr()));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&DragDropController::ForwardPendingLongTap,
+ weak_factory_.GetWeakPtr()));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698