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

Unified Diff: base/message_pump_x.cc

Issue 8566037: aura: Fix unit_tests on linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years, 1 month 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 | « no previous file | chrome/browser/profiles/profile_info_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_pump_x.cc
diff --git a/base/message_pump_x.cc b/base/message_pump_x.cc
index 3b1ed3da1f58dab6517656fe06fc9ed8eb0fe1f8..8a253df9e3a14f7eced3164906782575e3c0631c 100644
--- a/base/message_pump_x.cc
+++ b/base/message_pump_x.cc
@@ -183,6 +183,8 @@ bool MessagePumpX::RunOnce(GMainContext* context, bool block) {
}
bool MessagePumpX::WillProcessXEvent(XEvent* xevent) {
+ if (!observers().might_have_observers())
+ return false;
ObserverListBase<MessagePumpObserver>::Iterator it(observers());
MessagePumpObserver* obs;
while ((obs = it.GetNext()) != NULL) {
@@ -193,11 +195,7 @@ bool MessagePumpX::WillProcessXEvent(XEvent* xevent) {
}
void MessagePumpX::DidProcessXEvent(XEvent* xevent) {
- ObserverListBase<MessagePumpObserver>::Iterator it(observers());
- MessagePumpObserver* obs;
- while ((obs = it.GetNext()) != NULL) {
- obs->DidProcessEvent(xevent);
- }
+ FOR_EACH_OBSERVER(MessagePumpObserver, observers(), DidProcessEvent(xevent));
}
} // namespace base
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_info_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698