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

Side by Side Diff: base/process/launch_win.cc

Issue 1546313002: Conditionally set CREATE_BREAKAWAY_FROM_JOB when job objects are used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch v2 Created 4 years, 11 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 | « no previous file | no next file » | 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 "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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698