| Index: runtime/bin/websocket.dart
|
| diff --git a/runtime/bin/websocket.dart b/runtime/bin/websocket.dart
|
| index ef8876cafd4bdd3928642687a540514ebf409578..5b5b862dabe6addcbca90a6316a1f825b16a161a 100644
|
| --- a/runtime/bin/websocket.dart
|
| +++ b/runtime/bin/websocket.dart
|
| @@ -5,7 +5,7 @@
|
| /**
|
| * Web socket status codes used when closing a web socket connection.
|
| */
|
| -interface WebSocketStatus {
|
| +abstract class WebSocketStatus {
|
| static const int NORMAL_CLOSURE = 1000;
|
| static const int GOING_AWAY = 1001;
|
| static const int PROTOCOL_ERROR = 1002;
|
| @@ -38,8 +38,8 @@ interface WebSocketStatus {
|
| *
|
| * This handler strives to implement web sockets as specified by RFC6455.
|
| */
|
| -interface WebSocketHandler default _WebSocketHandler {
|
| - WebSocketHandler();
|
| +abstract class WebSocketHandler {
|
| + factory WebSocketHandler() => new _WebSocketHandler();
|
|
|
| /**
|
| * Request handler to be registered with the HTTP server.
|
| @@ -57,7 +57,7 @@ interface WebSocketHandler default _WebSocketHandler {
|
| /**
|
| * Server web socket connection.
|
| */
|
| -interface WebSocketConnection extends Hashable {
|
| +abstract class WebSocketConnection implements Hashable {
|
| /**
|
| * Sets the callback to be called when a message have been
|
| * received. The type on [message] is either [:String:] or
|
| @@ -96,14 +96,15 @@ interface WebSocketConnection extends Hashable {
|
| /**
|
| * Client web socket connection.
|
| */
|
| -interface WebSocketClientConnection
|
| - extends Hashable default _WebSocketClientConnection {
|
| +abstract class WebSocketClientConnection implements Hashable {
|
| /**
|
| * Creates a new web socket client connection based on a HTTP client
|
| * connection. The HTTP client connection must be freshly opened.
|
| */
|
| - WebSocketClientConnection(HttpClientConnection conn,
|
| - [List<String> protocols]);
|
| + factory WebSocketClientConnection(HttpClientConnection conn,
|
| + [List<String> protocols]) {
|
| + return new _WebSocketClientConnection(conn, protocols);
|
| + }
|
|
|
| /**
|
| * Sets the callback to be called when the request object for the
|
| @@ -166,15 +167,15 @@ interface WebSocketClientConnection
|
|
|
|
|
| /**
|
| - * Base interface for the events generated by the W3C complient
|
| - * browser API for web sockets.
|
| + * Base class for the events generated by the W3C complient browser
|
| + * API for web sockets.
|
| */
|
| -interface Event { }
|
| +abstract class Event { }
|
|
|
| /**
|
| * Event delivered when there is data on a web socket connection.
|
| */
|
| -interface MessageEvent extends Event default _WebSocketMessageEvent {
|
| +abstract class MessageEvent extends Event {
|
| /**
|
| * The type of [message] is either [:String:] or [:List<int>:]
|
| * depending on whether it is a text or binary message. If the
|
| @@ -187,7 +188,7 @@ interface MessageEvent extends Event default _WebSocketMessageEvent {
|
| /**
|
| * Event delivered when a web socket connection is closed.
|
| */
|
| -interface CloseEvent extends Event default _WebSocketCloseEvent {
|
| +abstract class CloseEvent extends Event {
|
| /**
|
| * Returns whether the connection was closed cleanly or not.
|
| */
|
| @@ -212,7 +213,7 @@ interface CloseEvent extends Event default _WebSocketCloseEvent {
|
| * with the W3C browser API for web sockets specified in
|
| * http://dev.w3.org/html5/websockets/.
|
| */
|
| -interface WebSocket default _WebSocket {
|
| +abstract class WebSocket {
|
| /**
|
| * Possible states of the connection.
|
| */
|
| @@ -227,7 +228,7 @@ interface WebSocket default _WebSocket {
|
| * [:String:] or [:List<String>:] specifying the subprotocols the
|
| * client is willing to speak.
|
| */
|
| - WebSocket(String url, [protocols]);
|
| + factory WebSocket(String url, [protocols]) => new _WebSocket(url, protocols);
|
|
|
| /**
|
| * Returns the current state of the connection.
|
|
|