diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-07 21:52:15 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-07 21:52:15 +0000 |
commit | 17b891482a081341470ead21ca7eda953d74dd69 (patch) | |
tree | 1ca1393109504064e44a31435714a238ca171477 /chrome/common/ipc_sync_channel_unittest.cc | |
parent | 209c36546ae088f1cf76e7f72765ad92b3cdaa2e (diff) | |
download | chromium_src-17b891482a081341470ead21ca7eda953d74dd69.zip chromium_src-17b891482a081341470ead21ca7eda953d74dd69.tar.gz chromium_src-17b891482a081341470ead21ca7eda953d74dd69.tar.bz2 |
Switch MessagePumpForIO to use completion ports on Windows.
Cleanup the separation between MessagePumpForUI and
MessagePumpForIO, and convert the latter to use Completion
Ports instead of MsgWaitForMultipleobjects to sleep
when idle.
Remove all traces of Windows messages from MessagePumpForIO,
remove the transitional API of completion port notifications
and remove WatchObject API.
Modify all callers of RegisterIOHandler so that they are no
longer using RegisterIOContext, and also handle properly
the new semantics of completion ports (notifications even when
the IO completes immediately).
Add a new interface to allow proper cleanup of disk cache (to
replace code that was waiting for pending APCs from the destructor).
Add a way for the message pump to perform cleanup of abandoned IO.
BUG=B/1344358, 3497, 3630
TESt=unit tests
R=darin
Review URL: http://codereview.chromium.org/8156
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5021 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_sync_channel_unittest.cc')
-rw-r--r-- | chrome/common/ipc_sync_channel_unittest.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/chrome/common/ipc_sync_channel_unittest.cc b/chrome/common/ipc_sync_channel_unittest.cc index 1d28b06..749a507 100644 --- a/chrome/common/ipc_sync_channel_unittest.cc +++ b/chrome/common/ipc_sync_channel_unittest.cc @@ -104,7 +104,7 @@ class Worker : public Channel::Listener, public Message::Sender { channel_->Close(); } void Start() { - StartThread(&listener_thread_); + StartThread(&listener_thread_, MessageLoop::TYPE_DEFAULT); ListenerThread()->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( this, &Worker::OnStart)); } @@ -149,7 +149,7 @@ class Worker : public Channel::Listener, public Message::Sender { // Called on the listener thread to create the sync channel. void OnStart() { // Link ipc_thread_, listener_thread_ and channel_ altogether. - StartThread(&ipc_thread_); + StartThread(&ipc_thread_, MessageLoop::TYPE_IO); channel_.reset(new SyncChannel( channel_name_, mode_, this, NULL, ipc_thread_.message_loop(), true, TestProcess::GetShutDownEvent())); @@ -178,9 +178,9 @@ class Worker : public Channel::Listener, public Message::Sender { IPC_END_MESSAGE_MAP() } - void StartThread(base::Thread* thread) { + void StartThread(base::Thread* thread, MessageLoop::Type type) { base::Thread::Options options; - options.message_loop_type = MessageLoop::TYPE_IO; + options.message_loop_type = type; thread->StartWithOptions(options); } |