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 // API for communicating with a Google Cast device over an authenticated | 5 // API for communicating with a Google Cast device over an authenticated |
6 // channel. | 6 // channel. |
7 namespace cast.channel { | 7 namespace cast.channel { |
8 | 8 |
9 // The state of the channel. | 9 // The state of the channel. |
10 enum ReadyState { | 10 enum ReadyState { |
(...skipping 25 matching lines...) Expand all Loading... | |
36 // There was an error writing or reading from the underlying socket. | 36 // There was an error writing or reading from the underlying socket. |
37 socket_error, | 37 socket_error, |
38 // A transport level occurred (like an unparseable message). | 38 // A transport level occurred (like an unparseable message). |
39 transport_error, | 39 transport_error, |
40 // The client attempted to send an unsupported message type through the | 40 // The client attempted to send an unsupported message type through the |
41 // channel. | 41 // channel. |
42 invalid_message, | 42 invalid_message, |
43 // An invalid channel id was passed. | 43 // An invalid channel id was passed. |
44 invalid_channel_id, | 44 invalid_channel_id, |
45 // Unspecified error. | 45 // Unspecified error. |
46 unknown | 46 unknown, |
47 // The connection could not be established before timing out. | |
48 connect_timeout | |
mark a. foltz
2014/07/17 23:56:50
Can we leave "unknown" as the last enum value?
Kevin M
2014/07/22 18:51:49
Done. This a forward compatible change, right? Jav
mark a. foltz
2014/07/22 18:57:53
Enums are passed by string, e.g. 'connection_timeo
| |
47 }; | 49 }; |
48 | 50 |
49 // Authentication methods that may be required to connect to a Cast receiver. | 51 // Authentication methods that may be required to connect to a Cast receiver. |
50 enum ChannelAuthType { | 52 enum ChannelAuthType { |
51 // SSL over TCP. | 53 // SSL over TCP. |
52 ssl, | 54 ssl, |
53 // SSL over TCP with challenge and receiver signature verification. | 55 // SSL over TCP with challenge and receiver signature verification. |
54 ssl_verified | 56 ssl_verified |
55 }; | 57 }; |
56 | 58 |
57 // Describes the information needed to connect to a Cast receiver. | 59 // Describes the information needed to connect to a Cast receiver. |
58 // This replaces the prior use of cast:// and casts:// URLs. | 60 // This replaces the prior use of cast:// and casts:// URLs. |
59 dictionary ConnectInfo { | 61 dictionary ConnectInfo { |
60 // The IPV4 address of the Cast receiver, e.g. '198.1.0.2'. | 62 // The IPV4 address of the Cast receiver, e.g. '198.1.0.2'. |
61 // TODO(mfoltz): Investigate whether IPV6 addresses "just work." | 63 // TODO(mfoltz): Investigate whether IPV6 addresses "just work." |
62 DOMString ipAddress; | 64 DOMString ipAddress; |
63 | 65 |
64 // The port number to connect to, 0-65535. | 66 // The port number to connect to, 0-65535. |
65 long port; | 67 long port; |
66 | 68 |
69 // The amount of time to wait in milliseconds before stopping the | |
70 // connection process. Timeouts are disabled if the value is zero. | |
71 // The default timeout is 5000ms/5 seconds. | |
72 long? timeout; | |
mark a. foltz
2014/07/17 23:56:50
Maybe just 5000 ms.
Kevin M
2014/07/22 18:51:49
OK. 8000ms to match cloudview.sender.ChannelServic
| |
73 | |
67 // The authentication method required for the channel. | 74 // The authentication method required for the channel. |
68 ChannelAuthType auth; | 75 ChannelAuthType auth; |
69 }; | 76 }; |
70 | 77 |
71 // Describes the state of a channel to a Cast receiver. | 78 // Describes the state of a channel to a Cast receiver. |
72 dictionary ChannelInfo { | 79 dictionary ChannelInfo { |
73 // Id for the channel. | 80 // Id for the channel. |
74 long channelId; | 81 long channelId; |
75 | 82 |
76 // DEPRECATED: The URL to the receiver. This field will be removed in a | 83 // DEPRECATED: The URL to the receiver. This field will be removed in a |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 interface Events { | 161 interface Events { |
155 // Fired when a message is received on an open channel. | 162 // Fired when a message is received on an open channel. |
156 static void onMessage(ChannelInfo channel, | 163 static void onMessage(ChannelInfo channel, |
157 MessageInfo message); | 164 MessageInfo message); |
158 | 165 |
159 // Fired when an error occurs as a result of a channel method or a network | 166 // Fired when an error occurs as a result of a channel method or a network |
160 // event. | 167 // event. |
161 static void onError(ChannelInfo channel); | 168 static void onError(ChannelInfo channel); |
162 }; | 169 }; |
163 }; | 170 }; |
OLD | NEW |