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

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

Issue 25631005: Reuse thread when writing stdout/stderr on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make the thread a part of the StdHandle. Created 7 years, 2 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/eventhandler_win.cc ('k') | 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) 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/builtin.h" 8 #include "bin/builtin.h"
9 #include "bin/eventhandler.h" 9 #include "bin/eventhandler.h"
10 #include "bin/file.h" 10 #include "bin/file.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 handle = GetStdHandle(STD_OUTPUT_HANDLE); 191 handle = GetStdHandle(STD_OUTPUT_HANDLE);
192 break; 192 break;
193 case 2: 193 case 2:
194 handle = GetStdHandle(STD_ERROR_HANDLE); 194 handle = GetStdHandle(STD_ERROR_HANDLE);
195 break; 195 break;
196 default: UNREACHABLE(); 196 default: UNREACHABLE();
197 } 197 }
198 if (handle == INVALID_HANDLE_VALUE) { 198 if (handle == INVALID_HANDLE_VALUE) {
199 return -1; 199 return -1;
200 } 200 }
201 FileHandle* file_handle = new FileHandle(handle); 201 StdHandle* std_handle = new StdHandle(handle);
202 if (file_handle == NULL) return -1; 202 if (std_handle == NULL) return -1;
203 file_handle->MarkDoesNotSupportOverlappedIO(); 203 std_handle->MarkDoesNotSupportOverlappedIO();
204 file_handle->EnsureInitialized(EventHandler::delegate()); 204 std_handle->EnsureInitialized(EventHandler::delegate());
205 return reinterpret_cast<intptr_t>(file_handle); 205 return reinterpret_cast<intptr_t>(std_handle);
206 } 206 }
207 207
208 208
209 intptr_t ServerSocket::Accept(intptr_t fd) { 209 intptr_t ServerSocket::Accept(intptr_t fd) {
210 ListenSocket* listen_socket = reinterpret_cast<ListenSocket*>(fd); 210 ListenSocket* listen_socket = reinterpret_cast<ListenSocket*>(fd);
211 ClientSocket* client_socket = listen_socket->Accept(); 211 ClientSocket* client_socket = listen_socket->Accept();
212 if (client_socket != NULL) { 212 if (client_socket != NULL) {
213 return reinterpret_cast<intptr_t>(client_socket); 213 return reinterpret_cast<intptr_t>(client_socket);
214 } else { 214 } else {
215 return -1; 215 return -1;
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 IPPROTO_TCP, 439 IPPROTO_TCP,
440 TCP_NODELAY, 440 TCP_NODELAY,
441 reinterpret_cast<char *>(&on), 441 reinterpret_cast<char *>(&on),
442 sizeof(on)) == 0; 442 sizeof(on)) == 0;
443 } 443 }
444 444
445 } // namespace bin 445 } // namespace bin
446 } // namespace dart 446 } // namespace dart
447 447
448 #endif // defined(TARGET_OS_WINDOWS) 448 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/bin/eventhandler_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698