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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
225 if (options.wait) | 225 if (options.wait) |
226 WaitForSingleObject(process_info.process_handle(), INFINITE); | 226 WaitForSingleObject(process_info.process_handle(), INFINITE); |
227 | 227 |
228 // If the caller wants the process handle, we won't close it. | 228 // If the caller wants the process handle, we won't close it. |
229 if (process_handle) | 229 if (process_handle) |
230 process_handle->Set(process_info.TakeProcessHandle()); | 230 process_handle->Set(process_info.TakeProcessHandle()); |
231 | 231 |
232 return true; | 232 return true; |
233 } | 233 } |
234 | 234 |
235 // TODO(rvargas) crbug.com/416721: Remove this stub after LaunchProcess is | |
236 // fully migrated to use Process. | |
237 Process LaunchProcess(const string16& cmdline, | |
238 const LaunchOptions& options) { | |
239 win::ScopedHandle process; | |
gab
2014/11/27 13:28:44
s/process/process_handle
(for naming consistency w
rvargas (doing something else)
2014/12/01 20:50:36
Done.
| |
240 if (LaunchProcess(cmdline, options, &process)) | |
241 return Process(process.Take()); | |
242 | |
243 return Process(); | |
244 } | |
245 | |
235 bool LaunchProcess(const CommandLine& cmdline, | 246 bool LaunchProcess(const CommandLine& cmdline, |
gab
2014/11/27 13:28:44
Is this still needed? (and similarly should that d
rvargas (doing something else)
2014/12/01 20:50:36
Yeah, this function is what prevents me from switc
| |
236 const LaunchOptions& options, | 247 const LaunchOptions& options, |
237 ProcessHandle* process_handle) { | 248 ProcessHandle* process_handle) { |
238 if (!process_handle) | 249 if (!process_handle) |
239 return LaunchProcess(cmdline.GetCommandLineString(), options, NULL); | 250 return LaunchProcess(cmdline.GetCommandLineString(), options, NULL); |
240 | 251 |
241 win::ScopedHandle process; | 252 win::ScopedHandle process; |
242 bool rv = LaunchProcess(cmdline.GetCommandLineString(), options, &process); | 253 bool rv = LaunchProcess(cmdline.GetCommandLineString(), options, &process); |
243 *process_handle = process.Take(); | 254 *process_handle = process.Take(); |
244 return rv; | 255 return rv; |
245 } | 256 } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
363 WaitForSingleObject(proc_info.process_handle(), INFINITE); | 374 WaitForSingleObject(proc_info.process_handle(), INFINITE); |
364 | 375 |
365 return true; | 376 return true; |
366 } | 377 } |
367 | 378 |
368 void RaiseProcessToHighPriority() { | 379 void RaiseProcessToHighPriority() { |
369 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); | 380 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); |
370 } | 381 } |
371 | 382 |
372 } // namespace base | 383 } // namespace base |
OLD | NEW |