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 // Use the <code>chrome.socket</code> API to send and receive data over the | 5 // Use the <code>chrome.socket</code> API to send and receive data over the |
6 // network using TCP and UDP connections. <b>Note:</b> Starting with Chrome 33, | 6 // network using TCP and UDP connections. <b>Note:</b> Starting with Chrome 33, |
7 // this API is deprecated in favor of the $(ref:sockets.udp), $(ref:sockets.tcp)
and | 7 // this API is deprecated in favor of the $(ref:sockets.udp), $(ref:sockets.tcp)
and |
8 // $(ref:sockets.tcpServer) APIs. | 8 // $(ref:sockets.tcpServer) APIs. |
9 namespace socket { | 9 namespace socket { |
10 enum SocketType { | 10 enum SocketType { |
(...skipping 11 matching lines...) Expand all Loading... |
22 }; | 22 }; |
23 | 23 |
24 callback CreateCallback = void (CreateInfo createInfo); | 24 callback CreateCallback = void (CreateInfo createInfo); |
25 | 25 |
26 callback ConnectCallback = void (long result); | 26 callback ConnectCallback = void (long result); |
27 | 27 |
28 callback BindCallback = void (long result); | 28 callback BindCallback = void (long result); |
29 | 29 |
30 callback ListenCallback = void (long result); | 30 callback ListenCallback = void (long result); |
31 | 31 |
| 32 callback SecureCallback = void (long result); |
| 33 |
32 dictionary AcceptInfo { | 34 dictionary AcceptInfo { |
33 long resultCode; | 35 long resultCode; |
34 // The id of the accepted socket. | 36 // The id of the accepted socket. |
35 long? socketId; | 37 long? socketId; |
36 }; | 38 }; |
37 | 39 |
38 callback AcceptCallback = void (AcceptInfo acceptInfo); | 40 callback AcceptCallback = void (AcceptInfo acceptInfo); |
39 | 41 |
40 dictionary ReadInfo { | 42 dictionary ReadInfo { |
41 // The resultCode returned from the underlying read() call. | 43 // The resultCode returned from the underlying read() call. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // "eth0", "lo", etc. | 104 // "eth0", "lo", etc. |
103 DOMString name; | 105 DOMString name; |
104 | 106 |
105 // The available IPv4/6 address. | 107 // The available IPv4/6 address. |
106 DOMString address; | 108 DOMString address; |
107 | 109 |
108 // The prefix length | 110 // The prefix length |
109 long prefixLength; | 111 long prefixLength; |
110 }; | 112 }; |
111 | 113 |
| 114 dictionary TLSVersionConstraints { |
| 115 // The minimum and maximum acceptable versions of TLS. These will |
| 116 // be <code>ssl3</code>, <code>tls1</code>, <code>tls1.1</code>, |
| 117 // or <code>tls1.2</code>. |
| 118 DOMString? min; |
| 119 DOMString? max; |
| 120 }; |
| 121 |
| 122 dictionary SecureOptions { |
| 123 TLSVersionConstraints? tlsVersion; |
| 124 }; |
| 125 |
112 callback RecvFromCallback = void (RecvFromInfo recvFromInfo); | 126 callback RecvFromCallback = void (RecvFromInfo recvFromInfo); |
113 | 127 |
114 callback SendToCallback = void (WriteInfo writeInfo); | 128 callback SendToCallback = void (WriteInfo writeInfo); |
115 | 129 |
116 callback SetKeepAliveCallback = void (boolean result); | 130 callback SetKeepAliveCallback = void (boolean result); |
117 | 131 |
118 callback SetNoDelayCallback = void (boolean result); | 132 callback SetNoDelayCallback = void (boolean result); |
119 | 133 |
120 callback GetInfoCallback = void (SocketInfo result); | 134 callback GetInfoCallback = void (SocketInfo result); |
121 | 135 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 static void setMulticastLoopbackMode( | 341 static void setMulticastLoopbackMode( |
328 long socketId, | 342 long socketId, |
329 boolean enabled, | 343 boolean enabled, |
330 SetMulticastLoopbackModeCallback callback); | 344 SetMulticastLoopbackModeCallback callback); |
331 | 345 |
332 // Get the multicast group addresses the socket is currently joined to. | 346 // Get the multicast group addresses the socket is currently joined to. |
333 // |socketId| : The socketId. | 347 // |socketId| : The socketId. |
334 // |callback| : Called with an array of strings of the result. | 348 // |callback| : Called with an array of strings of the result. |
335 static void getJoinedGroups(long socketId, | 349 static void getJoinedGroups(long socketId, |
336 GetJoinedGroupsCallback callback); | 350 GetJoinedGroupsCallback callback); |
| 351 |
| 352 // Start a TLS client connection over a connected TCP client socket. |
| 353 // |socketId| : The connected socket to use. |
| 354 // |options| : Constraints and parameters for the TLS connection. |
| 355 // |callback| : Called when the TLS connection attempt is complete. |
| 356 static void secure(long socketId, |
| 357 optional SecureOptions options, |
| 358 SecureCallback callback); |
337 }; | 359 }; |
338 | 360 |
339 }; | 361 }; |
OLD | NEW |