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

Unified Diff: base/message_pump_glib.cc

Issue 4007004: Revert 63397 - Add a message pump for touchui=1... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 2 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_pump_glib.h ('k') | base/message_pump_glib_x.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « base/message_pump_glib.h ('k') | base/message_pump_glib_x.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698