OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/common/child_process_host.h" | 5 #include "chrome/common/child_process_host.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 bool did_crash = base::DidProcessCrash(NULL, handle()); | 198 bool did_crash = base::DidProcessCrash(NULL, handle()); |
199 if (did_crash) { | 199 if (did_crash) { |
200 // Report that this child process crashed. | 200 // Report that this child process crashed. |
201 Notify(NotificationType::CHILD_PROCESS_CRASHED); | 201 Notify(NotificationType::CHILD_PROCESS_CRASHED); |
202 } | 202 } |
203 // Notify in the main loop of the disconnection. | 203 // Notify in the main loop of the disconnection. |
204 Notify(NotificationType::CHILD_PROCESS_HOST_DISCONNECTED); | 204 Notify(NotificationType::CHILD_PROCESS_HOST_DISCONNECTED); |
205 | 205 |
206 // On POSIX, once we've called DidProcessCrash, handle() is no longer | 206 // On POSIX, once we've called DidProcessCrash, handle() is no longer |
207 // valid. Ensure the destructor doesn't try to use it. | 207 // valid. Ensure the destructor doesn't try to use it. |
208 set_handle(NULL); | 208 set_handle(base::kNullProcessHandle); |
209 | 209 |
210 delete this; | 210 delete this; |
211 } | 211 } |
212 | 212 |
213 ChildProcessHost::ListenerHook::ListenerHook(ChildProcessHost* host) | 213 ChildProcessHost::ListenerHook::ListenerHook(ChildProcessHost* host) |
214 : host_(host) { | 214 : host_(host) { |
215 } | 215 } |
216 | 216 |
217 void ChildProcessHost::ListenerHook::OnMessageReceived( | 217 void ChildProcessHost::ListenerHook::OnMessageReceived( |
218 const IPC::Message& msg) { | 218 const IPC::Message& msg) { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 305 |
306 return *iterator_; | 306 return *iterator_; |
307 } while (true); | 307 } while (true); |
308 | 308 |
309 return NULL; | 309 return NULL; |
310 } | 310 } |
311 | 311 |
312 bool ChildProcessHost::Iterator::Done() { | 312 bool ChildProcessHost::Iterator::Done() { |
313 return iterator_ == Singleton<ChildProcessList>::get()->end(); | 313 return iterator_ == Singleton<ChildProcessList>::get()->end(); |
314 } | 314 } |
OLD | NEW |