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

Unified Diff: base/message_pump_glib.h

Issue 115812: linux: fix main loop issues with windowless plugins (Closed)
Patch Set: Fixing comments Created 11 years, 7 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 | « no previous file | base/message_pump_glib.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_pump_glib.h
diff --git a/base/message_pump_glib.h b/base/message_pump_glib.h
index 4fafaaff0655b75dd873f56d208cec172a61b657..e8288a8477b32388491e49fb7b3ccd8f542a7366 100644
--- a/base/message_pump_glib.h
+++ b/base/message_pump_glib.h
@@ -42,9 +42,11 @@ class MessagePumpForUI : public MessagePump {
// Internal methods used for processing the pump callbacks. They are
// public for simplicity but should not be used directly. HandlePrepare
// is called during the prepare step of glib, and returns a timeout that
- // will be passed to the poll. HandleDispatch is called after the poll
- // has completed.
+ // will be passed to the poll. HandleCheck is called after the poll
+ // has completed, and returns whether or not HandleDispatch should be called.
+ // HandleDispatch is called if HandleCheck returned true.
int HandlePrepare();
+ bool HandleCheck();
void HandleDispatch();
// Add an Observer, which will start receiving notifications immediately.
@@ -66,9 +68,10 @@ class MessagePumpForUI : public MessagePump {
// Used to count how many Run() invocations are on the stack.
int run_depth;
- // Used internally for controlling whether we want a message pump
- // iteration to be blocking or not.
- bool more_work_is_plausible;
+ // This keeps the state of whether the pump got signaled that there was new
+ // work to be done. Since we eat the message on the wake up pipe as soon as
+ // we get it, we keep that state here to stay consistent.
+ bool has_work;
};
// Invoked from EventDispatcher. Notifies all observers we're about to
« no previous file with comments | « no previous file | base/message_pump_glib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698