| 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 startup_info->hStdInput = options.stdin_handle; | 265 startup_info->hStdInput = options.stdin_handle; |
| 266 startup_info->hStdOutput = options.stdout_handle; | 266 startup_info->hStdOutput = options.stdout_handle; |
| 267 startup_info->hStdError = options.stderr_handle; | 267 startup_info->hStdError = options.stderr_handle; |
| 268 } | 268 } |
| 269 | 269 |
| 270 if (options.job_handle) { | 270 if (options.job_handle) { |
| 271 flags |= CREATE_SUSPENDED; | 271 flags |= CREATE_SUSPENDED; |
| 272 | 272 |
| 273 // If this code is run under a debugger, the launched process is | 273 // If this code is run under a debugger, the launched process is |
| 274 // automatically associated with a job object created by the debugger. | 274 // automatically associated with a job object created by the debugger. |
| 275 // The CREATE_BREAKAWAY_FROM_JOB flag is used to prevent this. | 275 // The CREATE_BREAKAWAY_FROM_JOB flag is used to prevent this on Windows |
| 276 flags |= CREATE_BREAKAWAY_FROM_JOB; | 276 // releases that do not support nested jobs. |
| 277 if (win::GetVersion() < win::VERSION_WIN8) |
| 278 flags |= CREATE_BREAKAWAY_FROM_JOB; |
| 277 } | 279 } |
| 278 | 280 |
| 279 if (options.force_breakaway_from_job_) | 281 if (options.force_breakaway_from_job_) |
| 280 flags |= CREATE_BREAKAWAY_FROM_JOB; | 282 flags |= CREATE_BREAKAWAY_FROM_JOB; |
| 281 | 283 |
| 282 PROCESS_INFORMATION temp_process_info = {}; | 284 PROCESS_INFORMATION temp_process_info = {}; |
| 283 | 285 |
| 284 string16 writable_cmdline(cmdline); | 286 string16 writable_cmdline(cmdline); |
| 285 if (options.as_user) { | 287 if (options.as_user) { |
| 286 flags |= CREATE_UNICODE_ENVIRONMENT; | 288 flags |= CREATE_UNICODE_ENVIRONMENT; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 | 382 |
| 381 bool GetAppOutput(const StringPiece16& cl, std::string* output) { | 383 bool GetAppOutput(const StringPiece16& cl, std::string* output) { |
| 382 return GetAppOutputInternal(cl, false, output); | 384 return GetAppOutputInternal(cl, false, output); |
| 383 } | 385 } |
| 384 | 386 |
| 385 void RaiseProcessToHighPriority() { | 387 void RaiseProcessToHighPriority() { |
| 386 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); | 388 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); |
| 387 } | 389 } |
| 388 | 390 |
| 389 } // namespace base | 391 } // namespace base |
| OLD | NEW |