diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-23 21:03:04 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-23 21:03:04 +0000 |
commit | 6eaddcc1be66c1ffb3980a6b5b1fe0f106be67e9 (patch) | |
tree | 69b4e4ef0c667919461d92cc91e020f3b5122ba2 /chrome/common/child_process_host.cc | |
parent | 9f37ca87b7226929d4156a4ad00116f76876404d (diff) | |
download | chromium_src-6eaddcc1be66c1ffb3980a6b5b1fe0f106be67e9.zip chromium_src-6eaddcc1be66c1ffb3980a6b5b1fe0f106be67e9.tar.gz chromium_src-6eaddcc1be66c1ffb3980a6b5b1fe0f106be67e9.tar.bz2 |
Make plugin_process_host.cc and child_process_host.cc compile on Posix.
Review URL: http://codereview.chromium.org/27018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10210 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/child_process_host.cc')
-rw-r--r-- | chrome/common/child_process_host.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/chrome/common/child_process_host.cc b/chrome/common/child_process_host.cc index ac3c681..66d3ebf 100644 --- a/chrome/common/child_process_host.cc +++ b/chrome/common/child_process_host.cc @@ -8,6 +8,7 @@ #include "base/logging.h" #include "base/message_loop.h" #include "base/singleton.h" +#include "base/waitable_event.h" #include "chrome/browser/chrome_thread.h" #include "chrome/common/ipc_logging.h" #include "chrome/common/notification_service.h" @@ -40,9 +41,10 @@ class ChildNotificationTask : public Task { ChildProcessHost::ChildProcessHost( ProcessType type, MessageLoop* main_message_loop) : ChildProcessInfo(type), + ALLOW_THIS_IN_INITIALIZER_LIST(listener_(this)), main_message_loop_(main_message_loop), opening_channel_(false), - ALLOW_THIS_IN_INITIALIZER_LIST(listener_(this)) { + process_event_(NULL) { Singleton<ChildProcessList>::get()->push_back(this); } @@ -69,9 +71,13 @@ bool ChildProcessHost::CreateChannel() { } void ChildProcessHost::SetHandle(base::ProcessHandle process) { - DCHECK(handle() == NULL); +#if defined(OS_WIN) + process_event_.reset(new base::WaitableEvent(process)); + + DCHECK(!handle()); set_handle(process); - watcher_.StartWatching(process, this); + watcher_.StartWatching(process_event_.get(), this); +#endif } void ChildProcessHost::InstanceCreated() { @@ -91,7 +97,9 @@ void ChildProcessHost::Notify(NotificationType type) { FROM_HERE, new ChildNotificationTask(type, this)); } -void ChildProcessHost::OnObjectSignaled(HANDLE object) { +void ChildProcessHost::OnWaitableEventSignaled(base::WaitableEvent *event) { +#if defined(OS_WIN) + HANDLE object = event->handle(); DCHECK(handle()); DCHECK_EQ(object, handle()); @@ -102,12 +110,11 @@ void ChildProcessHost::OnObjectSignaled(HANDLE object) { } // Notify in the main loop of the disconnection. Notify(NotificationType::CHILD_PROCESS_HOST_DISCONNECTED); +#endif delete this; } - - ChildProcessHost::ListenerHook::ListenerHook(ChildProcessHost* host) : host_(host) { } |