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

Side by Side Diff: base/process_util_posix.cc

Issue 10694131: Switch to TimeDelta interface for process waiting functions in base. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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 | « no previous file | base/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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <dirent.h> 5 #include <dirent.h>
6 #include <errno.h> 6 #include <errno.h>
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <signal.h> 8 #include <signal.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <sys/resource.h> 10 #include <sys/resource.h>
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 base::TimeDelta wait, 1242 base::TimeDelta wait,
1243 const ProcessFilter* filter) { 1243 const ProcessFilter* filter) {
1244 return WaitForProcessesToExit(executable_name, wait.InMilliseconds(), filter); 1244 return WaitForProcessesToExit(executable_name, wait.InMilliseconds(), filter);
1245 } 1245 }
1246 1246
1247 bool CleanupProcesses(const FilePath::StringType& executable_name, 1247 bool CleanupProcesses(const FilePath::StringType& executable_name,
1248 int64 wait_milliseconds, 1248 int64 wait_milliseconds,
1249 int exit_code, 1249 int exit_code,
1250 const ProcessFilter* filter) { 1250 const ProcessFilter* filter) {
1251 bool exited_cleanly = 1251 bool exited_cleanly =
1252 WaitForProcessesToExit(executable_name, wait_milliseconds, 1252 WaitForProcessesToExit(
1253 filter); 1253 executable_name,
1254 base::TimeDelta::FromMilliseconds(wait_milliseconds),
1255 filter);
1254 if (!exited_cleanly) 1256 if (!exited_cleanly)
1255 KillProcesses(executable_name, exit_code, filter); 1257 KillProcesses(executable_name, exit_code, filter);
1256 return exited_cleanly; 1258 return exited_cleanly;
1257 } 1259 }
1258 1260
1259 #if !defined(OS_MACOSX) 1261 #if !defined(OS_MACOSX)
1260 1262
1261 namespace { 1263 namespace {
1262 1264
1263 // Return true if the given child is dead. This will also reap the process. 1265 // Return true if the given child is dead. This will also reap the process.
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 if (IsChildDead(process)) 1349 if (IsChildDead(process))
1348 return; 1350 return;
1349 1351
1350 BackgroundReaper* reaper = new BackgroundReaper(process, 0); 1352 BackgroundReaper* reaper = new BackgroundReaper(process, 0);
1351 PlatformThread::CreateNonJoinable(0, reaper); 1353 PlatformThread::CreateNonJoinable(0, reaper);
1352 } 1354 }
1353 1355
1354 #endif // !defined(OS_MACOSX) 1356 #endif // !defined(OS_MACOSX)
1355 1357
1356 } // namespace base 1358 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/process_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698