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

Unified Diff: base/message_loop/message_loop.cc

Issue 1891233006: mus: Fix handled status in UI event ack, add MessageLoop::NestingObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@eventresult
Patch Set: review comments 3 Created 4 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
« no previous file with comments | « base/message_loop/message_loop.h ('k') | base/message_loop/message_loop_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_loop.cc
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc
index 01e7512b19f09ce6d611c6b2db18161e55437dbf..f189637b2223b383c34bb0e4f17453dc9249aff4 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -121,6 +121,8 @@ MessageLoop::TaskObserver::~TaskObserver() {
MessageLoop::DestructionObserver::~DestructionObserver() {
}
+MessageLoop::NestingObserver::~NestingObserver() {}
+
//------------------------------------------------------------------------------
MessageLoop::MessageLoop(Type type)
@@ -263,6 +265,16 @@ void MessageLoop::RemoveDestructionObserver(
destruction_observers_.RemoveObserver(destruction_observer);
}
+void MessageLoop::AddNestingObserver(NestingObserver* observer) {
+ DCHECK_EQ(this, current());
+ nesting_observers_.AddObserver(observer);
+}
+
+void MessageLoop::RemoveNestingObserver(NestingObserver* observer) {
+ DCHECK_EQ(this, current());
+ nesting_observers_.RemoveObserver(observer);
+}
+
void MessageLoop::PostTask(
const tracked_objects::Location& from_here,
const Closure& task) {
@@ -576,6 +588,11 @@ void MessageLoop::HistogramEvent(int event) {
#endif
}
+void MessageLoop::NotifyBeginNestedLoop() {
+ FOR_EACH_OBSERVER(NestingObserver, nesting_observers_,
+ OnBeginNestedMessageLoop());
+}
+
bool MessageLoop::DoWork() {
if (!nestable_tasks_allowed_) {
// Task can't be executed right now.
« no previous file with comments | « base/message_loop/message_loop.h ('k') | base/message_loop/message_loop_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698