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

Side by Side Diff: process/launch_win.cc

Issue 2043183002: Update to Chromium //base at Chromium commit 01cb97b2e09618bbc3a60c7348f0a844eea20547. (Closed) Base URL: https://github.com/domokit/base.git@master
Patch Set: Created 4 years, 6 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 | « prefs/json_pref_store.h ('k') | process/process_util_unittest.cc » ('j') | 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 return; 168 return;
169 // Don't bother creating a new console for each child process if the 169 // Don't bother creating a new console for each child process if the
170 // parent process is invalid (eg: crashed). 170 // parent process is invalid (eg: crashed).
171 if (result == ERROR_GEN_FAILURE) 171 if (result == ERROR_GEN_FAILURE)
172 return; 172 return;
173 if (create_console_if_not_found) { 173 if (create_console_if_not_found) {
174 // Make a new console if attaching to parent fails with any other error. 174 // Make a new console if attaching to parent fails with any other error.
175 // It should be ERROR_INVALID_HANDLE at this point, which means the 175 // It should be ERROR_INVALID_HANDLE at this point, which means the
176 // browser was likely not started from a console. 176 // browser was likely not started from a console.
177 AllocConsole(); 177 AllocConsole();
178 } else {
179 return;
178 } 180 }
179 } 181 }
180 182
181 // Arbitrary byte count to use when buffering output lines. More 183 // Arbitrary byte count to use when buffering output lines. More
182 // means potential waste, less means more risk of interleaved 184 // means potential waste, less means more risk of interleaved
183 // log-lines in output. 185 // log-lines in output.
184 enum { kOutputBufferSize = 64 * 1024 }; 186 enum { kOutputBufferSize = 64 * 1024 };
185 187
186 if (freopen("CONOUT$", "w", stdout)) { 188 if (freopen("CONOUT$", "w", stdout)) {
187 setvbuf(stdout, NULL, _IOLBF, kOutputBufferSize); 189 setvbuf(stdout, NULL, _IOLBF, kOutputBufferSize);
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 378
377 bool GetAppOutput(const StringPiece16& cl, std::string* output) { 379 bool GetAppOutput(const StringPiece16& cl, std::string* output) {
378 return GetAppOutputInternal(cl, false, output); 380 return GetAppOutputInternal(cl, false, output);
379 } 381 }
380 382
381 void RaiseProcessToHighPriority() { 383 void RaiseProcessToHighPriority() {
382 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); 384 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
383 } 385 }
384 386
385 } // namespace base 387 } // namespace base
OLDNEW
« no previous file with comments | « prefs/json_pref_store.h ('k') | process/process_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698