diff options
author | jar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 06:58:56 +0000 |
---|---|---|
committer | jar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 06:58:56 +0000 |
commit | 7622bd0c36e11b0108d3a8dd256211c05ddf5ff5 (patch) | |
tree | 90863e4ca076ab3b75c8441fb06ea0fb55e40860 /base/message_loop.h | |
parent | 3db1536436d21dac66de1414a40a57560b7eee96 (diff) | |
download | chromium_src-7622bd0c36e11b0108d3a8dd256211c05ddf5ff5.zip chromium_src-7622bd0c36e11b0108d3a8dd256211c05ddf5ff5.tar.gz chromium_src-7622bd0c36e11b0108d3a8dd256211c05ddf5ff5.tar.bz2 |
M base/message_loop.h
M base/message_loop.cc
M chrome/common/ipc_sync_channel.cc
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.h')
-rw-r--r-- | base/message_loop.h | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/base/message_loop.h b/base/message_loop.h index 1d1e11b..ecb7e27 100644 --- a/base/message_loop.h +++ b/base/message_loop.h @@ -249,9 +249,12 @@ class MessageLoop { PostTask(from_here, new ReleaseTask<T>(object)); } - // Run the message loop + // Run the message loop. void Run(); + // Run just one pass through the message loop. + void RunOnce(); + // See description of Dispatcher for how Run uses Dispatcher. void Run(Dispatcher* dispatcher); @@ -347,11 +350,14 @@ class MessageLoop { : loop_(loop), dispatcher_(loop->dispatcher_), quit_now_(loop->quit_now_), - quit_received_(loop->quit_received_) { + quit_received_(loop->quit_received_), + run_depth_(loop->run_depth_) { loop->quit_now_ = loop->quit_received_ = false; + ++loop->run_depth_; } ~ScopedStateSave() { + loop_->run_depth_ = run_depth_; loop_->quit_received_ = quit_received_; loop_->quit_now_ = quit_now_; loop_->dispatcher_ = dispatcher_; @@ -362,6 +368,7 @@ class MessageLoop { Dispatcher* dispatcher_; bool quit_now_; bool quit_received_; + int run_depth_; }; // struct ScopedStateSave // A prioritized queue with interface that mostly matches std::queue<>. @@ -431,15 +438,21 @@ class MessageLoop { void InitMessageWnd(); - // The actual message loop implementation. Called by all flavors of Run(). + + // A function to encapsulate all the exception handling capability in the + // stacks around the running of a main message loop. // It will run the message loop in a SEH try block or not depending on the // set_SEH_restoration() flag. - void RunInternal(Dispatcher* dispatcher); + void RunHandler(Dispatcher* dispatcher, bool run_loop_once); - //---------------------------------------------------------------------------- - // A list of alternate message loop priority systems. The strategy_selector_ - // determines which one to actually use. - void RunTraditional(); + // A surrounding stack frame around the running of the message loop that + // supports all saving and restoring of state, as is needed for any/all (ugly) + // recursive calls. + void RunInternal(Dispatcher* dispatcher, bool run_loop_once); + + // An extended message loop (message pump) that loops mostly forever, and + // processes task, signals, timers, etc. + void RunTraditional(bool run_loop_once); //---------------------------------------------------------------------------- // A list of method wrappers with identical calling signatures (no arguments) |