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/process.h" | 12 #include "base/process/process.h" |
13 #include "base/synchronization/waitable_event_watcher.h" | 13 #include "base/synchronization/waitable_event_watcher.h" |
14 #include "content/browser/child_process_launcher.h" | 14 #include "content/browser/child_process_launcher.h" |
15 #include "content/browser/power_monitor_message_broadcaster.h" | 15 #include "content/browser/power_monitor_message_broadcaster.h" |
16 #include "content/public/browser/browser_child_process_host.h" | 16 #include "content/public/browser/browser_child_process_host.h" |
17 #include "content/public/browser/child_process_data.h" | 17 #include "content/public/browser/child_process_data.h" |
18 #include "content/public/common/child_process_host_delegate.h" | 18 #include "content/public/common/child_process_host_delegate.h" |
19 | 19 |
| 20 namespace base { |
| 21 class CommandLine; |
| 22 } |
| 23 |
20 namespace content { | 24 namespace content { |
21 | 25 |
22 class BrowserChildProcessHostIterator; | 26 class BrowserChildProcessHostIterator; |
23 class BrowserChildProcessObserver; | 27 class BrowserChildProcessObserver; |
24 class BrowserMessageFilter; | 28 class BrowserMessageFilter; |
25 | 29 |
26 // Plugins/workers and other child processes that live on the IO thread use this | 30 // Plugins/workers and other child processes that live on the IO thread use this |
27 // class. RenderProcessHostImpl is the main exception that doesn't use this | 31 // class. RenderProcessHostImpl is the main exception that doesn't use this |
28 /// class because it lives on the UI thread. | 32 /// class because it lives on the UI thread. |
29 class CONTENT_EXPORT BrowserChildProcessHostImpl | 33 class CONTENT_EXPORT BrowserChildProcessHostImpl |
30 : public BrowserChildProcessHost, | 34 : public BrowserChildProcessHost, |
31 public NON_EXPORTED_BASE(ChildProcessHostDelegate), | 35 public NON_EXPORTED_BASE(ChildProcessHostDelegate), |
32 public ChildProcessLauncher::Client { | 36 public ChildProcessLauncher::Client { |
33 public: | 37 public: |
34 BrowserChildProcessHostImpl( | 38 BrowserChildProcessHostImpl( |
35 int process_type, | 39 int process_type, |
36 BrowserChildProcessHostDelegate* delegate); | 40 BrowserChildProcessHostDelegate* delegate); |
37 virtual ~BrowserChildProcessHostImpl(); | 41 virtual ~BrowserChildProcessHostImpl(); |
38 | 42 |
39 // Terminates all child processes and deletes each BrowserChildProcessHost | 43 // Terminates all child processes and deletes each BrowserChildProcessHost |
40 // instance. | 44 // instance. |
41 static void TerminateAll(); | 45 static void TerminateAll(); |
42 | 46 |
43 // BrowserChildProcessHost implementation: | 47 // BrowserChildProcessHost implementation: |
44 virtual bool Send(IPC::Message* message) OVERRIDE; | 48 virtual bool Send(IPC::Message* message) OVERRIDE; |
45 virtual void Launch( | 49 virtual void Launch( |
46 SandboxedProcessLauncherDelegate* delegate, | 50 SandboxedProcessLauncherDelegate* delegate, |
47 CommandLine* cmd_line) OVERRIDE; | 51 base::CommandLine* cmd_line) OVERRIDE; |
48 virtual const ChildProcessData& GetData() const OVERRIDE; | 52 virtual const ChildProcessData& GetData() const OVERRIDE; |
49 virtual ChildProcessHost* GetHost() const OVERRIDE; | 53 virtual ChildProcessHost* GetHost() const OVERRIDE; |
50 virtual base::TerminationStatus GetTerminationStatus( | 54 virtual base::TerminationStatus GetTerminationStatus( |
51 bool known_dead, int* exit_code) OVERRIDE; | 55 bool known_dead, int* exit_code) OVERRIDE; |
52 virtual void SetNaClDebugStubPort(int port) OVERRIDE; | 56 virtual void SetNaClDebugStubPort(int port) OVERRIDE; |
53 virtual void SetName(const base::string16& name) OVERRIDE; | 57 virtual void SetName(const base::string16& name) OVERRIDE; |
54 virtual void SetHandle(base::ProcessHandle handle) OVERRIDE; | 58 virtual void SetHandle(base::ProcessHandle handle) OVERRIDE; |
55 | 59 |
56 // ChildProcessHostDelegate implementation: | 60 // ChildProcessHostDelegate implementation: |
57 virtual bool CanShutdown() OVERRIDE; | 61 virtual bool CanShutdown() OVERRIDE; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // Watches to see if the child process exits before the IPC channel has | 114 // Watches to see if the child process exits before the IPC channel has |
111 // been connected. Thereafter, its exit is determined by an error on the | 115 // been connected. Thereafter, its exit is determined by an error on the |
112 // IPC channel. | 116 // IPC channel. |
113 base::WaitableEventWatcher early_exit_watcher_; | 117 base::WaitableEventWatcher early_exit_watcher_; |
114 #endif | 118 #endif |
115 }; | 119 }; |
116 | 120 |
117 } // namespace content | 121 } // namespace content |
118 | 122 |
119 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 123 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
OLD | NEW |