| Index: mojo/services/public/interfaces/network/web_socket.mojom
|
| diff --git a/mojo/services/public/interfaces/network/web_socket.mojom b/mojo/services/public/interfaces/network/web_socket.mojom
|
| index 87f0d6c055b7b3d642167fa0dd766e3dd7081f5f..48e6eed7c823ac95c7a6d07bc80622cba37778b0 100644
|
| --- a/mojo/services/public/interfaces/network/web_socket.mojom
|
| +++ b/mojo/services/public/interfaces/network/web_socket.mojom
|
| @@ -14,19 +14,42 @@ interface WebSocket {
|
| };
|
| const uint16 kAbnormalCloseCode = 1006; // stolen from websocket_bridge
|
|
|
| - Connect(
|
| - string url, string[] protocols, string origin, WebSocketClient client);
|
| - Send(bool fin, MessageType type, handle<data_pipe_consumer> data);
|
| + // Initiates a WebSocket connection to the given url. |send_stream| is a data
|
| + // pipe which should remain open for the lifetime of the WebSocket. Data
|
| + // to send over the WebSocket should be written to the producer end of the
|
| + // |send_stream|.
|
| + Connect(string url,
|
| + string[] protocols,
|
| + string origin,
|
| + handle<data_pipe_consumer> send_stream,
|
| + WebSocketClient client);
|
| +
|
| + // Called after writing |num_bytes| worth of data to the WebSocket's
|
| + // |send_stream|.
|
| + Send(bool fin, MessageType type, uint32 num_bytes);
|
| +
|
| FlowControl(int64 quota);
|
| +
|
| Close(uint16 code, string reason);
|
| };
|
|
|
| interface WebSocketClient {
|
| - DidConnect(bool fail, string selected_subprotocol, string extensions);
|
| - DidReceiveData(
|
| - bool fin, WebSocket.MessageType type, handle<data_pipe_consumer> data);
|
| + // Called in response to a WebSocket.Connect call to indicate success or
|
| + // failure. |receive_stream| is a data pipe which where incoming data from
|
| + // the server is written.
|
| + DidConnect(bool fail,
|
| + string selected_subprotocol,
|
| + string extensions,
|
| + handle<data_pipe_consumer> receive_stream);
|
| +
|
| + // Called when there is |num_bytes| worth of incoming data available on the
|
| + // |receive_stream|.
|
| + DidReceiveData(bool fin, WebSocket.MessageType type, uint32 num_bytes);
|
| +
|
| DidReceiveFlowControl(int64 quota);
|
| +
|
| DidFail(string message);
|
| +
|
| DidClose(bool was_clean, uint16 code, string reason);
|
|
|
| // Blink has 3 extra methods that we don't implement, because they are used
|
|
|