OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 module mojo; | 5 module mojo; |
6 | 6 |
7 import "network/public/interfaces/cookie_store.mojom"; | 7 import "network/public/interfaces/cookie_store.mojom"; |
8 import "network/public/interfaces/http_server.mojom"; | 8 import "network/public/interfaces/http_server.mojom"; |
9 import "network/public/interfaces/net_address.mojom"; | 9 import "network/public/interfaces/net_address.mojom"; |
10 import "network/public/interfaces/network_error.mojom"; | 10 import "network/public/interfaces/network_error.mojom"; |
11 import "network/public/interfaces/tcp_bound_socket.mojom"; | 11 import "network/public/interfaces/tcp_bound_socket.mojom"; |
12 import "network/public/interfaces/tcp_connected_socket.mojom"; | 12 import "network/public/interfaces/tcp_connected_socket.mojom"; |
13 import "network/public/interfaces/udp_socket.mojom"; | 13 import "network/public/interfaces/udp_socket.mojom"; |
14 import "network/public/interfaces/url_loader.mojom"; | |
15 import "network/public/interfaces/web_socket.mojom"; | 14 import "network/public/interfaces/web_socket.mojom"; |
16 | 15 |
17 // TODO Darin suggests that this should probably be two classes. One for | 16 // TODO Darin suggests that this should probably be two classes. One for |
18 // high-level origin-build requests like WebSockets and HTTP, and the other for | 17 // high-level origin-build requests like WebSockets and HTTP, and the other for |
19 // non-origin-bound low-level stuff like DNS, UDP, and TCP. | 18 // non-origin-bound low-level stuff like DNS, UDP, and TCP. |
20 interface NetworkService { | 19 interface NetworkService { |
21 CreateURLLoader(URLLoader& loader); | |
22 | |
23 GetCookieStore(CookieStore& cookie_store); | 20 GetCookieStore(CookieStore& cookie_store); |
24 | 21 |
25 CreateWebSocket(WebSocket& socket); | 22 CreateWebSocket(WebSocket& socket); |
26 | 23 |
27 // Creates a TCP socket bound to a given local address. This bound socket | 24 // Creates a TCP socket bound to a given local address. This bound socket |
28 // can be used for creating a client or server socket on that local address. | 25 // can be used for creating a client or server socket on that local address. |
29 // | 26 // |
30 // If you want to create a client socket to connect to a server and are in | 27 // If you want to create a client socket to connect to a server and are in |
31 // the common case where you don't care about the local address it's bound | 28 // the common case where you don't care about the local address it's bound |
32 // to, use CreateTCPConnectedSocket. | 29 // to, use CreateTCPConnectedSocket. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // The local address can specify 0 for the port to specify that the OS should | 63 // The local address can specify 0 for the port to specify that the OS should |
67 // pick an available port for the given address, or it can pass 0 for the | 64 // pick an available port for the given address, or it can pass 0 for the |
68 // address and port for the OS to pick both the local address and port. In | 65 // address and port for the OS to pick both the local address and port. In |
69 // all success cases, the resulting local address will be passed to the | 66 // all success cases, the resulting local address will be passed to the |
70 // callback as bound_to. | 67 // callback as bound_to. |
71 CreateHttpServer(NetAddress local_address, | 68 CreateHttpServer(NetAddress local_address, |
72 HttpServerDelegate delegate) | 69 HttpServerDelegate delegate) |
73 => (NetworkError result, | 70 => (NetworkError result, |
74 NetAddress? bound_to); | 71 NetAddress? bound_to); |
75 }; | 72 }; |
OLD | NEW |