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

Side by Side Diff: runtime/bin/stdio_win.cc

Issue 850333002: Revert "Revert "Make stdout/stderr async"" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « runtime/bin/stdio_patch.dart ('k') | sdk/lib/_internal/compiler/js_lib/io_patch.dart » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "bin/stdio.h" 8 #include "bin/stdio.h"
9 9
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 if (!GetConsoleMode(h, &mode)) return; 58 if (!GetConsoleMode(h, &mode)) return;
59 if (enabled) { 59 if (enabled) {
60 mode |= ENABLE_LINE_INPUT; 60 mode |= ENABLE_LINE_INPUT;
61 } else { 61 } else {
62 mode &= ~ENABLE_LINE_INPUT; 62 mode &= ~ENABLE_LINE_INPUT;
63 } 63 }
64 SetConsoleMode(h, mode); 64 SetConsoleMode(h, mode);
65 } 65 }
66 66
67 67
68 bool Stdout::GetTerminalSize(int fd, int size[2]) { 68 bool Stdout::GetTerminalSize(int size[2]) {
69 HANDLE h; 69 HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
70 if (fd == 1) {
71 h = GetStdHandle(STD_OUTPUT_HANDLE);
72 } else {
73 h = GetStdHandle(STD_ERROR_HANDLE);
74 }
75 CONSOLE_SCREEN_BUFFER_INFO info; 70 CONSOLE_SCREEN_BUFFER_INFO info;
76 if (!GetConsoleScreenBufferInfo(h, &info)) return false; 71 if (!GetConsoleScreenBufferInfo(h, &info)) return false;
77 size[0] = info.srWindow.Right - info.srWindow.Left + 1; 72 size[0] = info.srWindow.Right - info.srWindow.Left + 1;
78 size[1] = info.srWindow.Bottom - info.srWindow.Top + 1; 73 size[1] = info.srWindow.Bottom - info.srWindow.Top + 1;
79 return true; 74 return true;
80 } 75 }
81 76
82 } // namespace bin 77 } // namespace bin
83 } // namespace dart 78 } // namespace dart
84 79
85 #endif // defined(TARGET_OS_WINDOWS) 80 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/bin/stdio_patch.dart ('k') | sdk/lib/_internal/compiler/js_lib/io_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698