Chromium Code Reviews| 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) { |