OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // The <code>chrome.webrtc.castUdpTransport</code> API creates a UDP | 5 // The <code>chrome.webrtc.castUdpTransport</code> API creates a UDP |
6 // transport for outer transport to send and receive data. This API is not | 6 // transport for outer transport to send and receive data. This API is not |
7 // useful when standalone since it does not have send and receive methods. | 7 // useful when standalone since it does not have send and receive methods. |
8 // It should be used as an inner transport for other transports such as | 8 // It should be used as an inner transport for other transports such as |
9 // castSendTransport. | 9 // castSendTransport. |
10 namespace webrtc.castUdpTransport { | 10 namespace webrtc.castUdpTransport { |
11 // The UDP socket address and port. | 11 // The UDP socket address and port. |
12 dictionary UdpParams { | 12 dictionary UdpParams { |
13 DOMString address; | 13 DOMString address; |
14 long port; | 14 long port; |
15 }; | 15 }; |
16 | 16 |
17 // Result of <code>create</code> call. | 17 // Result of <code>create</code> call. |
18 dictionary CreateInfo { | 18 dictionary CreateInfo { |
19 // The ID of the newly created UDP transport. | 19 // The ID of the newly created UDP transport. |
20 long tranportId; | 20 long transportId; |
21 | 21 |
22 // The transport params. | 22 // The transport params. |
23 UdpParams params; | 23 UdpParams params; |
24 }; | 24 }; |
25 | 25 |
26 // Callback from the <code>create</code> method. | 26 // Callback from the <code>create</code> method. |
27 // |createInfo| : The transport info. | 27 // |createInfo| : The transport info. |
28 // A null value indicates an error. | 28 // A null value indicates an error. |
29 callback CreateCallback = void (CreateInfo createInfo); | 29 callback CreateCallback = void (CreateInfo createInfo); |
30 | 30 |
31 interface Functions { | 31 interface Functions { |
32 // Creates a UDP transport. | 32 // Creates a UDP transport. |
33 // |callback| : Called when the transport has been created. | 33 // |callback| : Called when the transport has been created. |
34 [nocompile] static void create(CreateCallback callback); | 34 [nocompile] static void create(CreateCallback callback); |
35 | 35 |
36 // Destroys a UDP transport. | 36 // Destroys a UDP transport. |
37 // |transportId| : The transport ID. | 37 // |transportId| : The transport ID. |
38 [nocompile] static void destroy(long transportId); | 38 [nocompile] static void destroy(long transportId); |
39 | 39 |
40 // Starts to use the transport by providing remote UDP info. | 40 // Starts to use the transport by providing remote UDP info. |
41 // |transportId| : The transport ID. | 41 // |transportId| : The transport ID. |
42 // |remoteParams| : The address and port to send packets to. | 42 // |remoteParams| : The address and port to send packets to. |
43 [nocompile] static void start(long transportId, UdpParams remoteParams); | 43 [nocompile] static void start(long transportId, UdpParams remoteParams); |
44 | 44 |
45 // Stops using the transport. | 45 // Stops using the transport. |
46 // |transportId| : The transport ID. | 46 // |transportId| : The transport ID. |
47 [nocompile] static void stop(long transportId); | 47 [nocompile] static void stop(long transportId); |
48 }; | 48 }; |
49 }; | 49 }; |
OLD | NEW |