summaryrefslogtreecommitdiffstats
path: root/base/message_pump_win.cc
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-29 19:27:49 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-29 19:27:49 +0000
commit83aad14e14607a1bf1bea7c94d2cf71324b8a2d0 (patch)
tree473ba21deb70bd5a6ea5ee9bf53755e750930bce /base/message_pump_win.cc
parentf937fdab0eb469bc99ba79db3e66e30ba5d02fa5 (diff)
downloadchromium_src-83aad14e14607a1bf1bea7c94d2cf71324b8a2d0.zip
chromium_src-83aad14e14607a1bf1bea7c94d2cf71324b8a2d0.tar.gz
chromium_src-83aad14e14607a1bf1bea7c94d2cf71324b8a2d0.tar.bz2
Fix net_unittests hang observed on Vista. It turns out that a subpump was
being run within shell32, which was causing our kHaveWorkMsg to get dispatched. However, because that was occuring outside the context of a MessagePump::Run call, the handler for kHaveWorkMsg was returning early. Unfortunately, this means that it was failing to reset the have_work_ sentinel to 0. Because of that future calls to ScheduleWork would always be a no-op (as they return early when have_work_ is already set to 1). The proper fix is to just re-order the calls so that ProcessPumpReplacementMessage always runs in response to kHaveWorkMsg, but we still suppress calling DoWork until we are inside MessagePump::Run. TBR=rvargas,jar git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1544 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_pump_win.cc')
-rw-r--r--base/message_pump_win.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/base/message_pump_win.cc b/base/message_pump_win.cc
index c982173c..289e089 100644
--- a/base/message_pump_win.cc
+++ b/base/message_pump_win.cc
@@ -203,17 +203,18 @@ void MessagePumpWin::InitMessageWnd() {
}
void MessagePumpWin::HandleWorkMessage() {
+ // Let whatever would have run had we not been putting messages in the queue
+ // run now. This is an attempt to make our dummy message not starve other
+ // messages that may be in the Windows message queue. We also need to call
+ // this in order to ensure that have_work_ gets reset to 0.
+ ProcessPumpReplacementMessage();
+
// If we are being called outside of the context of Run, then don't do
// anything. This could correspond to a MessageBox call or something of
// that sort.
if (!state_)
return;
- // Let whatever would have run had we not been putting messages in the queue
- // run now. This is an attempt to make our dummy message not starve other
- // messages that may be in the Windows message queue.
- ProcessPumpReplacementMessage();
-
// Now give the delegate a chance to do some work. He'll let us know if he
// needs to do more work.
if (state_->delegate->DoWork())