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

Unified Diff: runtime/bin/socket_win.cc

Issue 2791423002: [dart:io] Don't close stdin with a socket finalizer (Closed)
Patch Set: Address comments Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/socket.cc ('k') | runtime/bin/stdio_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_win.cc
diff --git a/runtime/bin/socket_win.cc b/runtime/bin/socket_win.cc
index a7061f70ff900e6fcaa190c60bb8e50e25cb5061..3b0efe507e10a728d82de5da4e54cf76efcb7d58 100644
--- a/runtime/bin/socket_win.cc
+++ b/runtime/bin/socket_win.cc
@@ -82,6 +82,7 @@ bool Socket::Initialize() {
return (err == 0);
}
+
intptr_t Socket::Available(intptr_t fd) {
ClientSocket* client_socket = reinterpret_cast<ClientSocket*>(fd);
return client_socket->Available();
@@ -288,7 +289,8 @@ intptr_t Socket::GetStdioHandle(intptr_t num) {
if (handle == INVALID_HANDLE_VALUE) {
return -1;
}
- StdHandle* std_handle = new StdHandle(handle);
+ StdHandle* std_handle = StdHandle::Stdin(handle);
+ std_handle->Retain();
std_handle->MarkDoesNotSupportOverlappedIO();
std_handle->EnsureInitialized(EventHandler::delegate());
return reinterpret_cast<intptr_t>(std_handle);
« no previous file with comments | « runtime/bin/socket.cc ('k') | runtime/bin/stdio_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698