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/url_loader.mojom"; |
| 8 import "network/public/interfaces/network_error.mojom"; |
| 9 import "network/public/interfaces/web_socket.mojom"; |
| 10 |
| 11 interface HttpConnection { |
| 12 // Sets the OS send buffer size (in bytes) for the underlying socket. |
| 13 SetSendBufferSize(uint32 size) => (NetworkError result); |
| 14 |
| 15 // Sets the OS receive buffer size (in bytes) for the underlying socket. |
| 16 SetReceiveBufferSize(uint32 size) => (NetworkError result); |
| 17 }; |
| 18 |
| 19 interface HttpConnectionDelegate { |
| 20 // Called when an HTTP request is received. |
| 21 OnReceivedRequest(URLRequest request) => (URLResponse response); |
| 22 |
| 23 // Called with an WebSocket request is received. |
| 24 // |
| 25 // If the delegate decides to accept the request, it should respond with |
| 26 // non-null arguments in the callback. |send_stream| is a data pipe which |
| 27 // should remain open for the lifetime of the WebSocket. Data to send over the |
| 28 // WebSocket should be written to the producer end of the |send_stream|. |
| 29 // |web_socket| will be already connected. There is no need to call Connect() |
| 30 // on it. But |client| will still receive a DidConnect() notification. |
| 31 OnReceivedWebSocketRequest(URLRequest request) |
| 32 => (WebSocket&? web_socket, |
| 33 handle<data_pipe_consumer>? send_stream, |
| 34 WebSocketClient? client); |
| 35 }; |
OLD | NEW |