| 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 "base/process/launch.h" | 5 #include "base/process/launch.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <io.h> | 8 #include <io.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 << std::endl;; | 212 << std::endl;; |
| 213 return Process(); | 213 return Process(); |
| 214 } | 214 } |
| 215 } | 215 } |
| 216 base::win::ScopedProcessInformation process_info(temp_process_info); | 216 base::win::ScopedProcessInformation process_info(temp_process_info); |
| 217 | 217 |
| 218 if (options.job_handle) { | 218 if (options.job_handle) { |
| 219 if (0 == AssignProcessToJobObject(options.job_handle, | 219 if (0 == AssignProcessToJobObject(options.job_handle, |
| 220 process_info.process_handle())) { | 220 process_info.process_handle())) { |
| 221 DLOG(ERROR) << "Could not AssignProcessToObject."; | 221 DLOG(ERROR) << "Could not AssignProcessToObject."; |
| 222 KillProcess(process_info.process_handle(), kProcessKilledExitCode, true); | 222 Process scoped_process(process_info.TakeProcessHandle()); |
| 223 scoped_process.Terminate(kProcessKilledExitCode, true); |
| 223 return Process(); | 224 return Process(); |
| 224 } | 225 } |
| 225 | 226 |
| 226 ResumeThread(process_info.thread_handle()); | 227 ResumeThread(process_info.thread_handle()); |
| 227 } | 228 } |
| 228 | 229 |
| 229 if (options.wait) | 230 if (options.wait) |
| 230 WaitForSingleObject(process_info.process_handle(), INFINITE); | 231 WaitForSingleObject(process_info.process_handle(), INFINITE); |
| 231 | 232 |
| 232 return Process(process_info.TakeProcessHandle()); | 233 return Process(process_info.TakeProcessHandle()); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 WaitForSingleObject(proc_info.process_handle(), INFINITE); | 344 WaitForSingleObject(proc_info.process_handle(), INFINITE); |
| 344 | 345 |
| 345 return true; | 346 return true; |
| 346 } | 347 } |
| 347 | 348 |
| 348 void RaiseProcessToHighPriority() { | 349 void RaiseProcessToHighPriority() { |
| 349 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); | 350 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); |
| 350 } | 351 } |
| 351 | 352 |
| 352 } // namespace base | 353 } // namespace base |
| OLD | NEW |