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

Unified Diff: runtime/bin/socket_linux.cc

Issue 2760293002: [dart:io] Adds a finalizer to _NativeSocket to avoid socket leaks (Closed)
Patch Set: Address comments Created 3 years, 9 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_fuchsia.cc ('k') | runtime/bin/socket_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_linux.cc
diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_linux.cc
index 23427a740e465c8eb3c667d77229074334a99112..108186ffc834ddc7d4885f1cd6c8fda399af6199 100644
--- a/runtime/bin/socket_linux.cc
+++ b/runtime/bin/socket_linux.cc
@@ -46,6 +46,15 @@ bool Socket::FormatNumericAddress(const RawAddr& addr, char* address, int len) {
}
+Socket::Socket(intptr_t fd)
+ : ReferenceCounted(), fd_(fd), port_(ILLEGAL_PORT) {}
+
+
+void Socket::SetClosedFd() {
+ fd_ = kClosedFd;
+}
+
+
bool Socket::Initialize() {
// Nothing to do on Linux.
return true;
« no previous file with comments | « runtime/bin/socket_fuchsia.cc ('k') | runtime/bin/socket_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698