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

Unified Diff: ui/aura/mus/window_tree_client.cc

Issue 2818533003: Make nesting/running states a RunLoop rather than a MessageLoop concept. (Closed)
Patch Set: still need to check MessageLoop::current() in Mojo's RunLoopNestingObserver::GetForThread() Created 3 years, 7 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 | « ui/aura/mus/mus_mouse_location_updater.cc ('k') | ui/aura/window_event_dispatcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_tree_client.cc
diff --git a/ui/aura/mus/window_tree_client.cc b/ui/aura/mus/window_tree_client.cc
index f264e4d4805a9a7cad33ca76b042834253dad7c3..950bf1f8204a37ed0cd4ad573b30932c4480d8e3 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -14,6 +14,8 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
+#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "base/threading/thread.h"
#include "cc/base/switches.h"
#include "components/discardable_memory/client/client_discardable_shared_memory_manager.h"
@@ -86,16 +88,16 @@ struct WindowPortPropertyDataMus : public ui::PropertyData {
// Handles acknowledgment of an input event, either immediately when a nested
// message loop starts, or upon destruction.
-class EventAckHandler : public base::MessageLoop::NestingObserver {
+class EventAckHandler : public base::RunLoop::NestingObserver {
public:
explicit EventAckHandler(std::unique_ptr<EventResultCallback> ack_callback)
: ack_callback_(std::move(ack_callback)) {
DCHECK(ack_callback_);
- base::MessageLoop::current()->AddNestingObserver(this);
+ base::RunLoop::AddNestingObserverOnCurrentThread(this);
}
~EventAckHandler() override {
- base::MessageLoop::current()->RemoveNestingObserver(this);
+ base::RunLoop::RemoveNestingObserverOnCurrentThread(this);
if (ack_callback_) {
ack_callback_->Run(handled_ ? ui::mojom::EventResult::HANDLED
: ui::mojom::EventResult::UNHANDLED);
@@ -104,8 +106,8 @@ class EventAckHandler : public base::MessageLoop::NestingObserver {
void set_handled(bool handled) { handled_ = handled; }
- // base::MessageLoop::NestingObserver:
- void OnBeginNestedMessageLoop() override {
+ // base::RunLoop::NestingObserver:
+ void OnBeginNestedRunLoop() override {
// Acknowledge the event immediately if a nested message loop starts.
// Otherwise we appear unresponsive for the life of the nested message loop.
if (ack_callback_) {
« no previous file with comments | « ui/aura/mus/mus_mouse_location_updater.cc ('k') | ui/aura/window_event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698