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

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: Update Mac OS X impl. 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
Index: runtime/bin/socket_patch.dart
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index 512cdbe637e1f8029ebd6f684f834f63256e986a..632278675e88028893a8ace3c4eb615ba512c516 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;
+ setSocketId(id);
Søren Gjesse 2013/09/03 12:19:58 Just call nativeSetSocketId here.
Anders Johnsen 2013/09/03 12:43:32 Done.
+ }
+
int available() {
if (isClosing || isClosed) return 0;
var result = nativeAvailable();
@@ -653,6 +659,9 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
return nativeSetOption(option._value, enabled);
}
+ void setSocketId(int id) => nativeSetSocketId(id);
Søren Gjesse 2013/09/03 12:19:58 No need to this.
Anders Johnsen 2013/09/03 12:43:32 Done.
+
+ 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)

Powered by Google App Engine
This is Rietveld 408576698