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

Side by Side Diff: base/process/process_posix.cc

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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/process_metrics_win.cc ('k') | base/process/process_util_unittest.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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 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 "base/process/process.h" 5 #include "base/process/process.h"
6 6
7 #include <sys/resource.h> 7 #include <sys/resource.h>
8 #include <sys/wait.h> 8 #include <sys/wait.h>
9 9
10 #include "base/files/scoped_file.h" 10 #include "base/files/scoped_file.h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 288
289 void Process::Close() { 289 void Process::Close() {
290 process_ = kNullProcessHandle; 290 process_ = kNullProcessHandle;
291 // if the process wasn't terminated (so we waited) or the state 291 // if the process wasn't terminated (so we waited) or the state
292 // wasn't already collected w/ a wait from process_utils, we're gonna 292 // wasn't already collected w/ a wait from process_utils, we're gonna
293 // end up w/ a zombie when it does finally exit. 293 // end up w/ a zombie when it does finally exit.
294 } 294 }
295 295
296 #if !defined(OS_NACL_NONSFI) 296 #if !defined(OS_NACL_NONSFI)
297 bool Process::Terminate(int exit_code, bool wait) const { 297 bool Process::Terminate(int exit_code, bool wait) const {
298 // result_code isn't supportable. 298 // exit_code isn't supportable.
299 DCHECK(IsValid()); 299 DCHECK(IsValid());
300 DCHECK_GT(process_, 1); 300 CHECK_GT(process_, 0);
301
301 bool result = kill(process_, SIGTERM) == 0; 302 bool result = kill(process_, SIGTERM) == 0;
302 if (result && wait) { 303 if (result && wait) {
303 int tries = 60; 304 int tries = 60;
304 305
305 if (RunningOnValgrind()) { 306 if (RunningOnValgrind()) {
306 // Wait for some extra time when running under Valgrind since the child 307 // Wait for some extra time when running under Valgrind since the child
307 // processes may take some time doing leak checking. 308 // processes may take some time doing leak checking.
308 tries *= 2; 309 tries *= 2;
309 } 310 }
310 311
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 return false; 371 return false;
371 } 372 }
372 #endif // !defined(OS_LINUX) && !defined(OS_MACOSX) 373 #endif // !defined(OS_LINUX) && !defined(OS_MACOSX)
373 374
374 int Process::GetPriority() const { 375 int Process::GetPriority() const {
375 DCHECK(IsValid()); 376 DCHECK(IsValid());
376 return getpriority(PRIO_PROCESS, process_); 377 return getpriority(PRIO_PROCESS, process_);
377 } 378 }
378 379
379 } // namespace base 380 } // namespace base
OLDNEW
« no previous file with comments | « base/process/process_metrics_win.cc ('k') | base/process/process_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698