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

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: disable more checks Created 3 years, 8 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: 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 7618729447bb5cadd74713ff2a7fb7b3017cec51..ced213a7909d4e2e3e0342a4d40e328dcbdd83f1 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"
@@ -80,16 +82,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);
@@ -98,8 +100,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_) {

Powered by Google App Engine
This is Rietveld 408576698