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

Unified Diff: base/message_loop/message_pump_x11.cc

Issue 223483002: base: Do not allow MessagePumpObservers to consume events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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_pump_x11.h ('k') | chrome/browser/chromeos/device_uma.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_pump_x11.cc
diff --git a/base/message_loop/message_pump_x11.cc b/base/message_loop/message_pump_x11.cc
index a86e4fe386cc1f42936ac5c99e7dc8433d49cb35..276c0219789e53dcb4a931a23155745e0c3b6935 100644
--- a/base/message_loop/message_pump_x11.cc
+++ b/base/message_loop/message_pump_x11.cc
@@ -253,30 +253,21 @@ void MessagePumpX11::ProcessXEvent(MessagePumpDispatcher* dispatcher,
have_cookie = true;
}
- if (!WillProcessXEvent(xev)) {
- uint32_t action = dispatcher->Dispatch(xev);
- bool should_quit = (action & POST_DISPATCH_QUIT_LOOP);
- if (dispatcher != this && (action & POST_DISPATCH_PERFORM_DEFAULT))
- action = Dispatch(xev);
- if ((action & POST_DISPATCH_QUIT_LOOP) || should_quit)
- Quit();
- DidProcessXEvent(xev);
- }
+ WillProcessXEvent(xev);
+ uint32_t action = dispatcher->Dispatch(xev);
+ bool should_quit = (action & POST_DISPATCH_QUIT_LOOP);
+ if (dispatcher != this && (action & POST_DISPATCH_PERFORM_DEFAULT))
+ action = Dispatch(xev);
+ if ((action & POST_DISPATCH_QUIT_LOOP) || should_quit)
+ Quit();
+ DidProcessXEvent(xev);
if (have_cookie)
XFreeEventData(xev->xgeneric.display, &xev->xcookie);
}
-bool MessagePumpX11::WillProcessXEvent(XEvent* xevent) {
- if (!observers().might_have_observers())
- return false;
- ObserverListBase<MessagePumpObserver>::Iterator it(observers());
- MessagePumpObserver* obs;
- while ((obs = it.GetNext()) != NULL) {
- if (obs->WillProcessEvent(xevent))
- return true;
- }
- return false;
+void MessagePumpX11::WillProcessXEvent(XEvent* xevent) {
+ FOR_EACH_OBSERVER(MessagePumpObserver, observers(), WillProcessEvent(xevent));
sky 2014/04/03 15:43:21 I would just inline this now.
sadrul 2014/04/03 16:22:50 I have kept this in a separate function for now si
}
void MessagePumpX11::DidProcessXEvent(XEvent* xevent) {
« no previous file with comments | « base/message_loop/message_pump_x11.h ('k') | chrome/browser/chromeos/device_uma.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698