| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/process.h" | 12 #include "base/process.h" |
| 13 #include "base/synchronization/waitable_event.h" |
| 14 #include "base/synchronization/waitable_event_watcher.h" |
| 13 #include "content/browser/child_process_launcher.h" | 15 #include "content/browser/child_process_launcher.h" |
| 14 #include "content/public/browser/browser_child_process_host.h" | 16 #include "content/public/browser/browser_child_process_host.h" |
| 15 #include "content/public/browser/child_process_data.h" | 17 #include "content/public/browser/child_process_data.h" |
| 16 #include "content/public/common/child_process_host_delegate.h" | 18 #include "content/public/common/child_process_host_delegate.h" |
| 17 | 19 |
| 18 namespace content { | 20 namespace content { |
| 19 class BrowserChildProcessHostIterator; | 21 class BrowserChildProcessHostIterator; |
| 20 | 22 |
| 21 // Plugins/workers and other child processes that live on the IO thread use this | 23 // Plugins/workers and other child processes that live on the IO thread use this |
| 22 // class. RenderProcessHostImpl is the main exception that doesn't use this | 24 // class. RenderProcessHostImpl is the main exception that doesn't use this |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // ChildProcessHostDelegate implementation: | 79 // ChildProcessHostDelegate implementation: |
| 78 virtual bool CanShutdown() OVERRIDE; | 80 virtual bool CanShutdown() OVERRIDE; |
| 79 virtual void OnChildDisconnected() OVERRIDE; | 81 virtual void OnChildDisconnected() OVERRIDE; |
| 80 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 82 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 81 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 83 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
| 82 virtual void OnChannelError() OVERRIDE; | 84 virtual void OnChannelError() OVERRIDE; |
| 83 | 85 |
| 84 // ChildProcessLauncher::Client implementation. | 86 // ChildProcessLauncher::Client implementation. |
| 85 virtual void OnProcessLaunched() OVERRIDE; | 87 virtual void OnProcessLaunched() OVERRIDE; |
| 86 | 88 |
| 89 void OnProcessExitedEarly(base::WaitableEvent* event); |
| 90 |
| 87 ChildProcessData data_; | 91 ChildProcessData data_; |
| 88 BrowserChildProcessHostDelegate* delegate_; | 92 BrowserChildProcessHostDelegate* delegate_; |
| 89 scoped_ptr<ChildProcessHost> child_process_host_; | 93 scoped_ptr<ChildProcessHost> child_process_host_; |
| 90 | 94 |
| 91 scoped_ptr<ChildProcessLauncher> child_process_; | 95 scoped_ptr<ChildProcessLauncher> child_process_; |
| 96 |
| 97 #if defined(OS_WIN) |
| 98 // Watches to see if the child process exits before the IPC channel has |
| 99 // been connected. Thereafter, its exit is determined by an error on the |
| 100 // IPC channel. |
| 101 base::WaitableEventWatcher early_exit_watcher_; |
| 102 |
| 103 // Wraps the process in a WaitableEvent. This event is "signalled" when the |
| 104 // process exits. |
| 105 scoped_ptr<base::WaitableEvent> process_waitable_event_; |
| 106 #endif |
| 92 }; | 107 }; |
| 93 | 108 |
| 94 } // namespace content | 109 } // namespace content |
| 95 | 110 |
| 96 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 111 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |