OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 // ChildProcessLauncher::Client implementation. | 92 // ChildProcessLauncher::Client implementation. |
93 virtual void OnProcessLaunched() OVERRIDE {} | 93 virtual void OnProcessLaunched() OVERRIDE {} |
94 | 94 |
95 // Derived classes can override this to know if the process crashed. | 95 // Derived classes can override this to know if the process crashed. |
96 // |exit_code| is the status returned when the process crashed (for | 96 // |exit_code| is the status returned when the process crashed (for |
97 // posix, as returned from waitpid(), for Windows, as returned from | 97 // posix, as returned from waitpid(), for Windows, as returned from |
98 // GetExitCodeProcess()). | 98 // GetExitCodeProcess()). |
99 virtual void OnProcessCrashed(int exit_code) {} | 99 virtual void OnProcessCrashed(int exit_code) {} |
100 | 100 |
101 // Derived classes can override this to know if the process was | |
102 // killed. |exit_code| is the status returned when the process | |
103 // was killed (for posix, as returned from waitpid(), for Windows, | |
104 // as returned from GetExitCodeProcess()). | |
105 virtual void OnProcessWasKilled(int exit_code) {} | |
106 | |
107 // Returns the termination status of a child. |exit_code| is the | 101 // Returns the termination status of a child. |exit_code| is the |
108 // status returned when the process exited (for posix, as returned | 102 // status returned when the process exited (for posix, as returned |
109 // from waitpid(), for Windows, as returned from | 103 // from waitpid(), for Windows, as returned from |
110 // GetExitCodeProcess()). |exit_code| may be NULL. | 104 // GetExitCodeProcess()). |exit_code| may be NULL. |
111 virtual base::TerminationStatus GetChildTerminationStatus(int* exit_code); | 105 base::TerminationStatus GetChildTerminationStatus(int* exit_code); |
112 | 106 |
113 // ChildProcessHostDelegate implementation: | 107 // Overrides from ChildProcessHost |
114 virtual bool CanShutdown() OVERRIDE; | 108 virtual bool CanShutdown() OVERRIDE; |
115 virtual void OnChildDisconnected() OVERRIDE; | 109 virtual void OnChildDisconnected() OVERRIDE; |
116 virtual void ShutdownStarted() OVERRIDE; | 110 virtual void ShutdownStarted() OVERRIDE; |
117 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 111 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
118 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 112 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
119 | 113 |
120 // Removes this host from the host list. Calls ChildProcessHost::ForceShutdown | 114 // Removes this host from the host list. Calls ChildProcessHost::ForceShutdown |
121 void ForceShutdown(); | 115 void ForceShutdown(); |
122 | 116 |
123 // Controls whether the child process should be terminated on browser | 117 // Controls whether the child process should be terminated on browser |
(...skipping 28 matching lines...) Expand all Loading... |
152 scoped_ptr<ChildProcessLauncher> child_process_; | 146 scoped_ptr<ChildProcessLauncher> child_process_; |
153 #if defined(OS_WIN) | 147 #if defined(OS_WIN) |
154 base::WaitableEventWatcher child_watcher_; | 148 base::WaitableEventWatcher child_watcher_; |
155 #else | 149 #else |
156 base::WeakPtrFactory<BrowserChildProcessHost> task_factory_; | 150 base::WeakPtrFactory<BrowserChildProcessHost> task_factory_; |
157 #endif | 151 #endif |
158 bool disconnect_was_alive_; | 152 bool disconnect_was_alive_; |
159 }; | 153 }; |
160 | 154 |
161 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ | 155 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
OLD | NEW |