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

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: remove Synthetic tests that were added for NWViews 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
Index: base/message_pump_x.cc
diff --git a/base/message_pump_x.cc b/base/message_pump_x.cc
index 3b1ed3da1f58dab6517656fe06fc9ed8eb0fe1f8..fad60846539dd0cbe96a5854a333bf0f90d15aa5 100644
--- a/base/message_pump_x.cc
+++ b/base/message_pump_x.cc
@@ -94,6 +94,7 @@ MessagePumpX::MessagePumpX() : MessagePumpGlib(),
}
MessagePumpX::~MessagePumpX() {
+ FOR_EACH_OBSERVER(MessagePumpObserver, observers(), DestroyMessagePump());
g_source_destroy(x_source_);
g_source_unref(x_source_);
XCloseDisplay(g_xdisplay);
@@ -183,6 +184,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 +196,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

Powered by Google App Engine
This is Rietveld 408576698