| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 [DartPackage="mojo_services"] | |
| 6 module mojo; | |
| 7 | |
| 8 import "mojo/public/interfaces/network/network_error.mojom"; | |
| 9 import "network/public/interfaces/http_message.mojom"; | |
| 10 import "network/public/interfaces/web_socket.mojom"; | |
| 11 | |
| 12 interface HttpConnection { | |
| 13 // Sets the OS send buffer size (in bytes) for the underlying socket. | |
| 14 SetSendBufferSize(uint32 size) => (NetworkError result); | |
| 15 | |
| 16 // Sets the OS receive buffer size (in bytes) for the underlying socket. | |
| 17 SetReceiveBufferSize(uint32 size) => (NetworkError result); | |
| 18 }; | |
| 19 | |
| 20 interface HttpConnectionDelegate { | |
| 21 // Called when an HTTP request is received. | |
| 22 OnReceivedRequest(HttpRequest request) => (HttpResponse response); | |
| 23 | |
| 24 // Called when an WebSocket request is received. | |
| 25 // | |
| 26 // If the delegate decides to accept the request, it should respond with | |
| 27 // non-null arguments in the callback. |send_stream| is a data pipe which | |
| 28 // should remain open for the lifetime of the WebSocket. Data to send over the | |
| 29 // WebSocket should be written to the producer end of the |send_stream|. | |
| 30 // |web_socket| will be already connected. There is no need to call Connect() | |
| 31 // on it. But |client| will still receive a DidConnect() notification. | |
| 32 // | |
| 33 // NOTE: WebSocket server support is not fully implemented. For now the | |
| 34 // following are not supported: | |
| 35 // - negotiating subprotocol or extension; | |
| 36 // - fragmented or non-text messages; | |
| 37 // - failure or close notification; | |
| 38 // - flow control. | |
| 39 OnReceivedWebSocketRequest(HttpRequest request) | |
| 40 => (WebSocket&? web_socket, | |
| 41 handle<data_pipe_consumer>? send_stream, | |
| 42 WebSocketClient? client); | |
| 43 }; | |
| OLD | NEW |