OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |