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 module mojo; |
| 6 |
| 7 import "network/public/interfaces/http_request.mojom"; |
| 8 import "network/public/interfaces/http_response.mojom"; |
| 9 import "network/public/interfaces/network_error.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 with 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 OnReceivedWebSocketRequest(HttpRequest request) |
| 33 => (WebSocket&? web_socket, |
| 34 handle<data_pipe_consumer>? send_stream, |
| 35 WebSocketClient? client); |
| 36 }; |
OLD | NEW |