Index: base/message_pump_glib.cc |
=================================================================== |
--- base/message_pump_glib.cc (revision 63402) |
+++ base/message_pump_glib.cc (working copy) |
@@ -207,7 +207,8 @@ |
// Don't block if we think we have more work to do. |
bool block = !more_work_is_plausible; |
- more_work_is_plausible = RunOnce(context_, block); |
+ // g_main_context_iteration returns true if events have been dispatched. |
+ more_work_is_plausible = g_main_context_iteration(context_, block); |
if (state_->should_quit) |
break; |
@@ -231,11 +232,6 @@ |
state_ = previous_state; |
} |
-bool MessagePumpForUI::RunOnce(GMainContext* context, bool block) { |
- // g_main_context_iteration returns true if events have been dispatched. |
- return g_main_context_iteration(context, block); |
-} |
- |
// Return the timeout we want passed to poll. |
int MessagePumpForUI::HandlePrepare() { |
// We know we have work, but we haven't called HandleDispatch yet. Don't let |
@@ -336,21 +332,19 @@ |
ScheduleWork(); |
} |
-void MessagePumpForUI::DispatchEvents(GdkEvent* event) { |
- WillProcessEvent(event); |
- if (state_ && state_->dispatcher) { // state_ may be null during tests. |
- if (!state_->dispatcher->Dispatch(event)) |
- state_->should_quit = true; |
+// static |
+void MessagePumpForUI::EventDispatcher(GdkEvent* event, gpointer data) { |
+ MessagePumpForUI* message_pump = reinterpret_cast<MessagePumpForUI*>(data); |
+ |
+ message_pump->WillProcessEvent(event); |
+ if (message_pump->state_ && // state_ may be null during tests. |
+ message_pump->state_->dispatcher) { |
+ if (!message_pump->state_->dispatcher->Dispatch(event)) |
+ message_pump->state_->should_quit = true; |
} else { |
gtk_main_do_event(event); |
} |
- DidProcessEvent(event); |
+ message_pump->DidProcessEvent(event); |
} |
-// static |
-void MessagePumpForUI::EventDispatcher(GdkEvent* event, gpointer data) { |
- MessagePumpForUI* message_pump = reinterpret_cast<MessagePumpForUI*>(data); |
- message_pump->DispatchEvents(event); |
-} |
- |
} // namespace base |