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" |
(...skipping 24 matching lines...) Expand all Loading... | |
35 int process_type, | 35 int process_type, |
36 BrowserChildProcessHostDelegate* delegate); | 36 BrowserChildProcessHostDelegate* delegate); |
37 virtual ~BrowserChildProcessHostImpl(); | 37 virtual ~BrowserChildProcessHostImpl(); |
38 | 38 |
39 // Terminates all child processes and deletes each BrowserChildProcessHost | 39 // Terminates all child processes and deletes each BrowserChildProcessHost |
40 // instance. | 40 // instance. |
41 static void TerminateAll(); | 41 static void TerminateAll(); |
42 | 42 |
43 // BrowserChildProcessHost implementation: | 43 // BrowserChildProcessHost implementation: |
44 virtual bool Send(IPC::Message* message) OVERRIDE; | 44 virtual bool Send(IPC::Message* message) OVERRIDE; |
45 | |
45 virtual void Launch( | 46 virtual void Launch( |
46 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
47 SandboxedProcessLauncherDelegate* delegate, | 48 SandboxedProcessLauncherDelegate* delegate, |
49 bool launch_elevated, | |
48 #elif defined(OS_POSIX) | 50 #elif defined(OS_POSIX) |
49 bool use_zygote, | 51 bool use_zygote, |
50 const base::EnvironmentMap& environ, | 52 const base::EnvironmentMap& environ, |
51 #endif | 53 #endif |
52 CommandLine* cmd_line) OVERRIDE; | 54 CommandLine* cmd_line) OVERRIDE; |
53 virtual const ChildProcessData& GetData() const OVERRIDE; | 55 virtual const ChildProcessData& GetData() const OVERRIDE; |
54 virtual ChildProcessHost* GetHost() const OVERRIDE; | 56 virtual ChildProcessHost* GetHost() const OVERRIDE; |
55 virtual base::TerminationStatus GetTerminationStatus( | 57 virtual base::TerminationStatus GetTerminationStatus( |
56 bool known_dead, int* exit_code) OVERRIDE; | 58 bool known_dead, int* exit_code) OVERRIDE; |
57 virtual void SetName(const string16& name) OVERRIDE; | 59 virtual void SetName(const string16& name) OVERRIDE; |
58 virtual void SetHandle(base::ProcessHandle handle) OVERRIDE; | 60 virtual void SetHandle(base::ProcessHandle handle) OVERRIDE; |
59 | 61 |
60 // Returns the handle of the child process. This can be called only after | 62 // Returns the handle of the child process. This can be called only after |
61 // OnProcessLaunched is called or it will be invalid and may crash. | 63 // OnProcessLaunched is called or it will be invalid and may crash. |
62 base::ProcessHandle GetHandle() const; | 64 virtual base::ProcessHandle GetHandle() const; |
jam
2014/01/30 21:41:03
since this is part of ChildProcessHostDelegate, dr
Drew Haven
2014/01/31 20:00:12
Done.
| |
63 | 65 |
64 // Removes this host from the host list. Calls ChildProcessHost::ForceShutdown | 66 // Removes this host from the host list. Calls ChildProcessHost::ForceShutdown |
65 void ForceShutdown(); | 67 void ForceShutdown(); |
66 | 68 |
67 // Callers can reduce the BrowserChildProcess' priority. | 69 // Callers can reduce the BrowserChildProcess' priority. |
68 void SetBackgrounded(bool backgrounded); | 70 void SetBackgrounded(bool backgrounded); |
69 | 71 |
70 // Controls whether the child process should be terminated on browser | 72 // Controls whether the child process should be terminated on browser |
71 // shutdown. Default is to always terminate. | 73 // shutdown. Default is to always terminate. |
72 void SetTerminateChildOnShutdown(bool terminate_on_shutdown); | 74 void SetTerminateChildOnShutdown(bool terminate_on_shutdown); |
(...skipping 18 matching lines...) Expand all Loading... | |
91 | 93 |
92 // ChildProcessHostDelegate implementation: | 94 // ChildProcessHostDelegate implementation: |
93 virtual bool CanShutdown() OVERRIDE; | 95 virtual bool CanShutdown() OVERRIDE; |
94 virtual void OnChildDisconnected() OVERRIDE; | 96 virtual void OnChildDisconnected() OVERRIDE; |
95 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 97 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
96 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 98 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
97 virtual void OnChannelError() OVERRIDE; | 99 virtual void OnChannelError() OVERRIDE; |
98 | 100 |
99 // ChildProcessLauncher::Client implementation. | 101 // ChildProcessLauncher::Client implementation. |
100 virtual void OnProcessLaunched() OVERRIDE; | 102 virtual void OnProcessLaunched() OVERRIDE; |
103 virtual void OnProcessLaunchFailed() OVERRIDE; | |
101 | 104 |
102 #if defined(OS_WIN) | 105 #if defined(OS_WIN) |
103 void DeleteProcessWaitableEvent(base::WaitableEvent* event); | 106 void DeleteProcessWaitableEvent(base::WaitableEvent* event); |
104 void OnProcessExitedEarly(base::WaitableEvent* event); | 107 void OnProcessExitedEarly(base::WaitableEvent* event); |
105 #endif | 108 #endif |
106 | 109 |
107 ChildProcessData data_; | 110 ChildProcessData data_; |
108 BrowserChildProcessHostDelegate* delegate_; | 111 BrowserChildProcessHostDelegate* delegate_; |
109 scoped_ptr<ChildProcessHost> child_process_host_; | 112 scoped_ptr<ChildProcessHost> child_process_host_; |
110 | 113 |
111 scoped_ptr<ChildProcessLauncher> child_process_; | 114 scoped_ptr<ChildProcessLauncher> child_process_; |
112 | 115 |
113 PowerMonitorMessageBroadcaster power_monitor_message_broadcaster_; | 116 PowerMonitorMessageBroadcaster power_monitor_message_broadcaster_; |
114 | 117 |
115 #if defined(OS_WIN) | 118 #if defined(OS_WIN) |
116 // Watches to see if the child process exits before the IPC channel has | 119 // Watches to see if the child process exits before the IPC channel has |
117 // been connected. Thereafter, its exit is determined by an error on the | 120 // been connected. Thereafter, its exit is determined by an error on the |
118 // IPC channel. | 121 // IPC channel. |
119 base::WaitableEventWatcher early_exit_watcher_; | 122 base::WaitableEventWatcher early_exit_watcher_; |
120 #endif | 123 #endif |
121 }; | 124 }; |
122 | 125 |
123 } // namespace content | 126 } // namespace content |
124 | 127 |
125 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 128 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
OLD | NEW |