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 #include "content/browser/browser_child_process_host.h" | 5 #include "content/browser/browser_child_process_host.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // The child process handle has been signaled so the exit code is finally | 221 // The child process handle has been signaled so the exit code is finally |
222 // available. Unfortunately STILL_ACTIVE (0x103) is a valid exit code in | 222 // available. Unfortunately STILL_ACTIVE (0x103) is a valid exit code in |
223 // which case we should not call OnChildDisconnected() or else we will be | 223 // which case we should not call OnChildDisconnected() or else we will be |
224 // waiting forever. | 224 // waiting forever. |
225 void BrowserChildProcessHost::OnWaitableEventSignaled( | 225 void BrowserChildProcessHost::OnWaitableEventSignaled( |
226 base::WaitableEvent* waitable_event) { | 226 base::WaitableEvent* waitable_event) { |
227 #if defined (OS_WIN) | 227 #if defined (OS_WIN) |
228 unsigned long exit_code = 0; | 228 unsigned long exit_code = 0; |
229 GetExitCodeProcess(waitable_event->Release(), &exit_code); | 229 GetExitCodeProcess(waitable_event->Release(), &exit_code); |
230 delete waitable_event; | 230 delete waitable_event; |
231 if (exit_code == STILL_ACTIVE) | 231 if (exit_code == STILL_ACTIVE) { |
232 OnChildDied(); | 232 OnChildDied(); |
233 BrowserChildProcessHost::OnChildDisconnected(); | 233 } else { |
| 234 BrowserChildProcessHost::OnChildDisconnected(); |
| 235 } |
234 #endif | 236 #endif |
235 } | 237 } |
236 | 238 |
237 void BrowserChildProcessHost::ShutdownStarted() { | 239 void BrowserChildProcessHost::ShutdownStarted() { |
238 // Must remove the process from the list now, in case it gets used for a | 240 // Must remove the process from the list now, in case it gets used for a |
239 // new instance before our watcher tells us that the process terminated. | 241 // new instance before our watcher tells us that the process terminated. |
240 g_child_process_list.Get().remove(this); | 242 g_child_process_list.Get().remove(this); |
241 } | 243 } |
242 | 244 |
243 BrowserChildProcessHost::ClientHook::ClientHook(BrowserChildProcessHost* host) | 245 BrowserChildProcessHost::ClientHook::ClientHook(BrowserChildProcessHost* host) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 282 |
281 return *iterator_; | 283 return *iterator_; |
282 } while (true); | 284 } while (true); |
283 | 285 |
284 return NULL; | 286 return NULL; |
285 } | 287 } |
286 | 288 |
287 bool BrowserChildProcessHost::Iterator::Done() { | 289 bool BrowserChildProcessHost::Iterator::Done() { |
288 return iterator_ == g_child_process_list.Get().end(); | 290 return iterator_ == g_child_process_list.Get().end(); |
289 } | 291 } |
OLD | NEW |