diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-13 00:25:51 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-13 00:25:51 +0000 |
commit | 95fac4236a1bee1de60d59c0691b0b49eb05e6ad (patch) | |
tree | a91ca0abb087be94bf7030195529813fea7df1f9 /base/message_pump_glib.h | |
parent | 007f8e7a1b28d7a90ffac9fa31005dc9a464647c (diff) | |
download | chromium_src-95fac4236a1bee1de60d59c0691b0b49eb05e6ad.zip chromium_src-95fac4236a1bee1de60d59c0691b0b49eb05e6ad.tar.gz chromium_src-95fac4236a1bee1de60d59c0691b0b49eb05e6ad.tar.bz2 |
Restructure the the pump for nested loops.
Change our work dispatching to be based around an event source. This will allow us to still participate when a message loop is pumped by outside code (nested message loops).
Review URL: http://codereview.chromium.org/10854
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5331 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_pump_glib.h')
-rw-r--r-- | base/message_pump_glib.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/base/message_pump_glib.h b/base/message_pump_glib.h index 21a80df..d632095 100644 --- a/base/message_pump_glib.h +++ b/base/message_pump_glib.h @@ -25,6 +25,14 @@ class MessagePumpForUI : public MessagePump { virtual void ScheduleWork(); virtual void ScheduleDelayedWork(const Time& delayed_work_time); + // 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. + int HandlePrepare(); + void HandleDispatch(); + private: // We may make recursive calls to Run, so we save state that needs to be // separate between them in this structure type. @@ -36,6 +44,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; }; RunState* state_; |