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

Unified Diff: runtime/bin/socket_patch.dart

Issue 19263003: Add FileSystemWatcher class to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix android socket. Created 7 years, 3 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_macos.cc ('k') | runtime/bin/socket_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_patch.dart
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index 512cdbe637e1f8029ebd6f684f834f63256e986a..f4f07af239d7637b2553ce33c5f858a2e87d7508 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -368,6 +368,12 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
eventHandlers = new List(EVENT_COUNT + 1);
}
+ _NativeSocket.watch(int id) : typeFlags = TYPE_NORMAL_SOCKET {
+ eventHandlers = new List(EVENT_COUNT + 1);
+ isClosedWrite = true;
+ nativeSetSocketId(id);
+ }
+
int available() {
if (isClosing || isClosed) return 0;
var result = nativeAvailable();
@@ -653,6 +659,7 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
return nativeSetOption(option._value, enabled);
}
+ void nativeSetSocketId(int id) native "Socket_SetSocketId";
nativeAvailable() native "Socket_Available";
nativeRead(int len) native "Socket_Read";
nativeWrite(List<int> buffer, int offset, int bytes)
« no previous file with comments | « runtime/bin/socket_macos.cc ('k') | runtime/bin/socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698