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

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: Fix nesting observer issues with LazySchedulerMessageLoopDelegateForTests 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 6f5956f9f4bae396b86542f3f28ea016abbcb7b1..b7ab7bcdfab0429287abb57434478997c3680788 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"
@@ -81,16 +83,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);
@@ -99,8 +101,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