diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-15 10:30:44 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-15 10:30:44 +0000 |
commit | b44d5cc48e86d5def75da6d5d0d295bb93e7a11d (patch) | |
tree | f58f6ad4813973a4d27e82aefe170eca6170a4eb /base/message_pump_glib.cc | |
parent | bf9c004226d2c830367f442aa6068d67319d21c8 (diff) | |
download | chromium_src-b44d5cc48e86d5def75da6d5d0d295bb93e7a11d.zip chromium_src-b44d5cc48e86d5def75da6d5d0d295bb93e7a11d.tar.gz chromium_src-b44d5cc48e86d5def75da6d5d0d295bb93e7a11d.tar.bz2 |
Add tests for the GLib message pump.
This CL also adds a few comment updates that were lost in CL 115812 submission.
Patch by Antoine Labour.
Review URL: http://codereview.chromium.org/118155
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18379 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_pump_glib.cc')
-rw-r--r-- | base/message_pump_glib.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/base/message_pump_glib.cc b/base/message_pump_glib.cc index 1b973cb..ac0a080 100644 --- a/base/message_pump_glib.cc +++ b/base/message_pump_glib.cc @@ -59,11 +59,11 @@ int GetTimeIntervalMilliseconds(base::Time from) { // // gtk_events_pending just calls g_main_context_pending, which does the // following: -// - call prepare on all the sources -// - do the poll with a timeout of 0 (not blocking) -// - call check on all the sources -// - *does not* call dispatch on the sources -// - return true iff any of prepare() or check() returned true +// - Call prepare on all the sources. +// - Do the poll with a timeout of 0 (not blocking). +// - Call check on all the sources. +// - *Does not* call dispatch on the sources. +// - Return true if any of prepare() or check() returned true. // // gtk_main_iteration just calls g_main_context_iteration, which does the whole // thing, respecting the timeout for the poll (and block, although it is @@ -76,10 +76,10 @@ int GetTimeIntervalMilliseconds(base::Time from) { // after, from gtk_main_iteration. // // For the GLib pump we try to follow the Windows UI pump model: -// - whenever we receive a wakeup event or the timer for delayed work expires, +// - Whenever we receive a wakeup event or the timer for delayed work expires, // we run DoWork and/or DoDelayedWork. That part will also run in the other -// event pumps -// - we also run DoWork, DoDelayedWork, and possibly DoIdleWork in the main +// event pumps. +// - We also run DoWork, DoDelayedWork, and possibly DoIdleWork in the main // loop, around event handling. struct WorkSource : public GSource { @@ -197,7 +197,6 @@ void MessagePumpForUI::Run(Delegate* delegate) { more_work_is_plausible |= state_->delegate->DoDelayedWork(&delayed_work_time_); - if (state_->should_quit) break; @@ -254,7 +253,8 @@ bool MessagePumpForUI::HandleCheck() { void MessagePumpForUI::HandleDispatch() { state_->has_work = false; if (state_->delegate->DoWork()) { - // NOTE: on Windows at this point we would call ScheduleWork. But here, + // NOTE: on Windows at this point we would call ScheduleWork (see + // MessagePumpForUI::HandleWorkMessage in message_pump_win.cc). But here, // instead of posting a message on the wakeup pipe, we can avoid the // syscalls and just signal that we have more work. state_->has_work = true; |