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

Unified Diff: runtime/bin/websocket.dart

Issue 10383039: Implemented W3C complient web socket client interface (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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/websocket.dart
diff --git a/runtime/bin/websocket.dart b/runtime/bin/websocket.dart
index cca6747b4ce60edb947764cd99b43ba3015905d9..952ec9ed5de94925c97b28e40fc21ca9e759ae46 100644
--- a/runtime/bin/websocket.dart
+++ b/runtime/bin/websocket.dart
@@ -141,6 +141,41 @@ interface WebSocketClientConnection default _WebSocketClientConnection {
}
+interface WebSocketDataEvent default _WebSocketDataEvent {
+ get data();
+}
+
+
+interface WebSocketCloseEvent default _WebSocketCloseEvent {
+ bool get wasClean();
+ int get code();
+ String get reason();
+}
+
+
+interface WebSocket default _WebSocket {
+ static final int CONNECTING = 0;
+ static final int OPEN = 1;
+ static final int CLOSING = 2;
+ static final int CLOSED = 3;
+
+ WebSocket(String url, [protocols]);
Mads Ager (google) 2012/05/07 11:46:57 What is protocols? Is there a type that it makes s
Søren Gjesse 2012/05/07 12:55:24 Sorry abut that. I totally forgot the comments on
+
+ int get readyState();
+ int get bufferedAmount();
+
+ void set onopen(Function callback);
+ void set onerror(Function callback);
+ void set onclose(Function callback);
+ String get extensions();
+ String get protocol();
+ void close(int code, String reason);
+
+ void set onmessage(Function callback(event));
+ void send(data);
+}
+
+
class WebSocketException implements Exception {
const WebSocketException([String this.message = ""]);
String toString() => "WebSocketException: $message";

Powered by Google App Engine
This is Rietveld 408576698