Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: mojo/services/public/interfaces/network/network_service.mojom

Issue 613683006: Add TCP socket mojo interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split it apart Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 import "mojo/services/public/interfaces/network/cookie_store.mojom" 5 import "mojo/services/public/interfaces/network/cookie_store.mojom"
6 import "mojo/services/public/interfaces/network/net_address.mojom"
7 import "mojo/services/public/interfaces/network/network_error.mojom"
8 import "mojo/services/public/interfaces/network/tcp_bound_socket.mojom"
9 import "mojo/services/public/interfaces/network/tcp_client_socket.mojom"
6 import "mojo/services/public/interfaces/network/url_loader.mojom" 10 import "mojo/services/public/interfaces/network/url_loader.mojom"
7 import "mojo/services/public/interfaces/network/web_socket.mojom" 11 import "mojo/services/public/interfaces/network/web_socket.mojom"
8 12
9 module mojo { 13 module mojo {
10 14
11 interface NetworkService { 15 interface NetworkService {
12 CreateURLLoader(URLLoader&? loader); 16 CreateURLLoader(URLLoader&? loader);
13 17
14 GetCookieStore(CookieStore&? cookie_store); 18 GetCookieStore(CookieStore&? cookie_store);
15 19
16 CreateWebSocket(WebSocket& socket); 20 CreateWebSocket(WebSocket& socket);
17 21
18 // TODO(darin): Add other methods here. 22 // Creates a TCP socket bound to a given local address. This bound socket
darin (slow to review) 2014/10/02 05:14:59 not that this needs to happen now, but i think it'
23 // can be used for creating a client or server socket on that local address.
24 //
25 // If you want to create a client socket to connect to a server and are in
26 // the common case where you don't care about the local address it's bound
27 // to, use CreateTCPClientSocket.
28 //
29 // The local address can specify 0 for the port to specify that the OS should
30 // pick an available port for the given address, or it can pass 0 for the
31 // address and port for the OS to pick both the local address and port. In
32 // all success cases, the resulting local address will be passed to the
33 // callback as bound_to.
34 CreateTCPBoundSocket(NetAddress local_address,
35 TCPBoundSocket& bound_socket)
36 => (NetworkError result, NetAddress? bound_to);
37
38 // Creates a client socket connected to the given remote address. A local
39 // address and port will be allocated for the connection and passed to the
40 // callback on success.
41 //
42 // If you want control over the local address and port, instead use
43 // CreateTCPBoundSocket.
44 CreateTCPClientSocket(NetAddress remote_address,
45 handle<data_pipe_consumer> send_stream,
46 handle<data_pipe_producer> receive_stream,
47 TCPClientSocket& client_socket)
48 => (NetworkError result,
49 NetAddress? local_address);
19 }; 50 };
20 51
21 } 52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698