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

Side by Side Diff: base/process_util_posix.cc

Issue 10821062: Fix CleanupProcesses() interface to use TimeDelta. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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.h ('k') | base/process_util_win.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 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 result = true; 1220 result = true;
1221 break; 1221 break;
1222 } 1222 }
1223 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100)); 1223 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100));
1224 } while ((end_time - base::Time::Now()) > base::TimeDelta()); 1224 } while ((end_time - base::Time::Now()) > base::TimeDelta());
1225 1225
1226 return result; 1226 return result;
1227 } 1227 }
1228 1228
1229 bool CleanupProcesses(const FilePath::StringType& executable_name, 1229 bool CleanupProcesses(const FilePath::StringType& executable_name,
1230 int64 wait_milliseconds, 1230 base::TimeDelta wait,
1231 int exit_code, 1231 int exit_code,
1232 const ProcessFilter* filter) { 1232 const ProcessFilter* filter) {
1233 bool exited_cleanly = 1233 bool exited_cleanly = WaitForProcessesToExit(executable_name, wait, filter);
1234 WaitForProcessesToExit(
1235 executable_name,
1236 base::TimeDelta::FromMilliseconds(wait_milliseconds),
1237 filter);
1238 if (!exited_cleanly) 1234 if (!exited_cleanly)
1239 KillProcesses(executable_name, exit_code, filter); 1235 KillProcesses(executable_name, exit_code, filter);
1240 return exited_cleanly; 1236 return exited_cleanly;
1241 } 1237 }
1242 1238
1243 #if !defined(OS_MACOSX) 1239 #if !defined(OS_MACOSX)
1244 1240
1245 namespace { 1241 namespace {
1246 1242
1247 // Return true if the given child is dead. This will also reap the process. 1243 // 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
1331 if (IsChildDead(process)) 1327 if (IsChildDead(process))
1332 return; 1328 return;
1333 1329
1334 BackgroundReaper* reaper = new BackgroundReaper(process, 0); 1330 BackgroundReaper* reaper = new BackgroundReaper(process, 0);
1335 PlatformThread::CreateNonJoinable(0, reaper); 1331 PlatformThread::CreateNonJoinable(0, reaper);
1336 } 1332 }
1337 1333
1338 #endif // !defined(OS_MACOSX) 1334 #endif // !defined(OS_MACOSX)
1339 1335
1340 } // namespace base 1336 } // namespace base
OLDNEW
« no previous file with comments | « base/process_util.h ('k') | base/process_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698