Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: chrome/browser/child_process_launcher.cc

Issue 1315009: Make DidProcessCrash a bit more solid and accurate on Windows (Closed)
Patch Set: now with a test Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/process_util_win.cc ('k') | chrome/browser/nacl_host/nacl_process_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/browser/child_process_launcher.h" 5 #include "chrome/browser/child_process_launcher.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "base/thread.h" 10 #include "base/thread.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 #endif 305 #endif
306 { 306 {
307 did_crash = base::DidProcessCrash(&child_exited, handle); 307 did_crash = base::DidProcessCrash(&child_exited, handle);
308 } 308 }
309 309
310 // POSIX: If the process crashed, then the kernel closed the socket for it 310 // POSIX: If the process crashed, then the kernel closed the socket for it
311 // and so the child has already died by the time we get here. Since 311 // and so the child has already died by the time we get here. Since
312 // DidProcessCrash called waitpid with WNOHANG, it'll reap the process. 312 // DidProcessCrash called waitpid with WNOHANG, it'll reap the process.
313 // However, if DidProcessCrash didn't reap the child, we'll need to in 313 // However, if DidProcessCrash didn't reap the child, we'll need to in
314 // Terminate via ProcessWatcher. So we can't close the handle here. 314 // Terminate via ProcessWatcher. So we can't close the handle here.
315 //
316 // This is moot on Windows where |child_exited| will always be true.
317 if (child_exited) 315 if (child_exited)
318 context_->process_.Close(); 316 context_->process_.Close();
319 317
320 return did_crash; 318 return did_crash;
321 } 319 }
322 320
323 void ChildProcessLauncher::SetProcessBackgrounded(bool background) { 321 void ChildProcessLauncher::SetProcessBackgrounded(bool background) {
324 DCHECK(!context_->starting_); 322 DCHECK(!context_->starting_);
325 context_->process_.SetProcessBackgrounded(background); 323 context_->process_.SetProcessBackgrounded(background);
326 } 324 }
OLDNEW
« no previous file with comments | « base/process_util_win.cc ('k') | chrome/browser/nacl_host/nacl_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698