summaryrefslogtreecommitdiffstats
path: root/chrome/common/ipc_sync_channel.cc
diff options
context:
space:
mode:
authorjar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 19:03:59 +0000
committerjar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 19:03:59 +0000
commit3882c43300022509c46993d61893414ac8a8b7fb (patch)
tree538231d18e9cab60b0e1f626d32c8669486f539f /chrome/common/ipc_sync_channel.cc
parent4aed32afe2a17d07c8879de8d8d7857225f88537 (diff)
downloadchromium_src-3882c43300022509c46993d61893414ac8a8b7fb.zip
chromium_src-3882c43300022509c46993d61893414ac8a8b7fb.tar.gz
chromium_src-3882c43300022509c46993d61893414ac8a8b7fb.tar.bz2
(Re-landing of) Support RunOnce() in message loop.
Deeply nested calls to MessageLoop::Run() were made, and a multitude of Quit() messages were handled at the most nested level. This left outer invocations hung, waiting for "their" kQuitMsg to arrive (but the the nested loop had already discarded them in its processing of pending messages before exit :-/ ). We now use a more controlled run of the message loop, which does not rely on kQuitMsg. This re-landing doesn't have the anti-hang assertion, which was breaking a lot of tests. bug=1291034 r=darin,mpcomplete 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@130 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_sync_channel.cc')
-rw-r--r--chrome/common/ipc_sync_channel.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/chrome/common/ipc_sync_channel.cc b/chrome/common/ipc_sync_channel.cc
index bbd7a23..1dc106c 100644
--- a/chrome/common/ipc_sync_channel.cc
+++ b/chrome/common/ipc_sync_channel.cc
@@ -445,11 +445,10 @@ bool SyncChannel::Send(IPC::Message* message) {
// shutdown the nested loop when there are no more messages.
pump_messages_events_.push(pump_messages_event);
bool old_state = MessageLoop::current()->NestableTasksAllowed();
- // Insert a Quit message so that we just flush the MessageLoop without
- // letting the MessageLoop wait for more messages.
- MessageLoop::current()->Quit();
MessageLoop::current()->SetNestableTasksAllowed(true);
- MessageLoop::current()->Run();
+ // Process a message, but come right back out of the MessageLoop (don't
+ // loop, sleep, or wait for a kMsgQuit).
+ MessageLoop::current()->RunOnce();
MessageLoop::current()->SetNestableTasksAllowed(old_state);
pump_messages_events_.pop();
} else {