OLD | NEW |
1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 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 | 5 |
6 /** | 6 /** |
7 * This file defines the <code>PPB_WebSocket_Dev</code> interface. | 7 * This file defines the <code>PPB_WebSocket_Dev</code> interface. |
8 */ | 8 */ |
9 label Chrome { | 9 label Chrome { |
10 M17 = 0.1 | 10 M17 = 0.1 |
11 }; | 11 }; |
12 | 12 |
13 | 13 |
14 /** | 14 /** |
15 * This enumeration contains the types representing the WebSocket ready state | 15 * This enumeration contains the types representing the WebSocket ready state |
16 * and these states are based on the JavaScript WebSocket API specification. | 16 * and these states are based on the JavaScript WebSocket API specification. |
17 * GetReadyState() returns one of these states. | 17 * GetReadyState() returns one of these states. |
18 */ | 18 */ |
19 [assert_size(4)] | 19 [assert_size(4)] |
20 enum PP_WebSocketReadyState_Dev { | 20 enum PP_WebSocketReadyState_Dev { |
21 /** | 21 /** |
| 22 * Ready state is queried on an invalid resource. |
| 23 */ |
| 24 PP_WEBSOCKETREADYSTATE_INVALID_DEV = -1, |
| 25 /** |
22 * Ready state that the connection has not yet been established. | 26 * Ready state that the connection has not yet been established. |
23 */ | 27 */ |
24 PP_WEBSOCKETREADYSTATE_CONNECTING_DEV = 0, | 28 PP_WEBSOCKETREADYSTATE_CONNECTING_DEV = 0, |
25 | 29 |
26 /** | 30 /** |
27 * Ready state that the WebSocket connection is established and communication | 31 * Ready state that the WebSocket connection is established and communication |
28 * is possible. | 32 * is possible. |
29 */ | 33 */ |
30 PP_WEBSOCKETREADYSTATE_OPEN_DEV = 1, | 34 PP_WEBSOCKETREADYSTATE_OPEN_DEV = 1, |
31 | 35 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 */ | 229 */ |
226 uint16_t GetCloseCode([in] PP_Resource web_socket); | 230 uint16_t GetCloseCode([in] PP_Resource web_socket); |
227 | 231 |
228 /** | 232 /** |
229 * GetCloseReason() returns the connection close reason for the WebSocket | 233 * GetCloseReason() returns the connection close reason for the WebSocket |
230 * connection. | 234 * connection. |
231 * | 235 * |
232 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a | 236 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a |
233 * WebSocket. | 237 * WebSocket. |
234 * | 238 * |
235 * @return Returns a <code>PP_VARTYPE_NULL</code> var if called before the | 239 * @return Returns a <code>PP_VARTYPE_STRING</code> var. if called before the |
236 * close reason is set, or <code>PP_VARTYPE_UNDEFINED</code> if called on an | 240 * close reason is set, its data is empty string. Returns a |
237 * invalid resource. | 241 * <code>PP_VARTYPE_UNDEFINED</code> if called on an invalid resource. |
238 */ | 242 */ |
239 PP_Var GetCloseReason([in] PP_Resource web_socket); | 243 PP_Var GetCloseReason([in] PP_Resource web_socket); |
240 | 244 |
241 /** | 245 /** |
242 * GetCloseWasClean() returns if the connection was closed cleanly for the | 246 * GetCloseWasClean() returns if the connection was closed cleanly for the |
243 * specified WebSocket connection. | 247 * specified WebSocket connection. |
244 * | 248 * |
245 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a | 249 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a |
246 * WebSocket. | 250 * WebSocket. |
247 * | 251 * |
248 * @return Returns <code>PP_FALSE</code> if called before the connection is | 252 * @return Returns <code>PP_FALSE</code> if called before the connection is |
249 * closed. Otherwise, returns <code>PP_TRUE</code> if the connection was | 253 * closed, or called on an invalid resource. Otherwise, returns |
250 * closed cleanly and returns <code>PP_FALSE</code> if the connection was | 254 * <code>PP_TRUE</code> if the connection was closed cleanly, or returns |
251 * closed by abnormal reasons. | 255 * <code>PP_FALSE</code> if the connection was closed by abnormal reasons. |
252 */ | 256 */ |
253 PP_Bool GetCloseWasClean([in] PP_Resource web_socket); | 257 PP_Bool GetCloseWasClean([in] PP_Resource web_socket); |
254 | 258 |
255 /** | 259 /** |
256 * GetExtensions() returns the extensions selected by the server for the | 260 * GetExtensions() returns the extensions selected by the server for the |
257 * specified WebSocket connection. | 261 * specified WebSocket connection. |
258 * | 262 * |
259 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a | 263 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a |
260 * WebSocket. | 264 * WebSocket. |
261 * | 265 * |
262 * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the | 266 * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the |
263 * connection is established or called on an invalid resource, its data is | 267 * connection is established, its data is empty string. Returns a |
264 * empty string. | 268 * <code>PP_VARTYPE_UNDEFINED</code> if called on an invalid resource. |
265 * Currently its data is always empty string. | 269 * Currently its data for valid resources are always empty string. |
266 */ | 270 */ |
267 PP_Var GetExtensions([in] PP_Resource web_socket); | 271 PP_Var GetExtensions([in] PP_Resource web_socket); |
268 | 272 |
269 /** | 273 /** |
270 * GetProtocol() returns the sub-protocol chosen by the server for the | 274 * GetProtocol() returns the sub-protocol chosen by the server for the |
271 * specified WebSocket connection. | 275 * specified WebSocket connection. |
272 * | 276 * |
273 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a | 277 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a |
274 * WebSocket. | 278 * WebSocket. |
275 * | 279 * |
276 * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the | 280 * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the |
277 * connection is established, or called on an invalid resource, its data is | 281 * connection is established, its data is empty string. Returns a |
278 * empty string. | 282 * <code>PP_VARTYPE_UNDEFINED</code> if called on an invalid resource. |
279 */ | 283 */ |
280 PP_Var GetProtocol([in] PP_Resource web_socket); | 284 PP_Var GetProtocol([in] PP_Resource web_socket); |
281 | 285 |
282 /** | 286 /** |
283 * GetReadyState() returns the ready state of the specified WebSocket | 287 * GetReadyState() returns the ready state of the specified WebSocket |
284 * connection. | 288 * connection. |
285 * | 289 * |
286 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a | 290 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a |
287 * WebSocket. | 291 * WebSocket. |
288 * | 292 * |
289 * @return Returns <code>PP_WEBSOCKETREADYSTATE_CONNECTING</code> if called | 293 * @return Returns <code>PP_WEBSOCKETREADYSTATE_INVALID_DEV</code> if called |
290 * before the connection is established. | 294 * before connect() is called, or called on an invalid resource. |
291 */ | 295 */ |
292 PP_WebSocketReadyState_Dev GetReadyState([in] PP_Resource web_socket); | 296 PP_WebSocketReadyState_Dev GetReadyState([in] PP_Resource web_socket); |
293 | 297 |
294 /** | 298 /** |
295 * GetURL() returns the URL associated with specified WebSocket connection. | 299 * GetURL() returns the URL associated with specified WebSocket connection. |
296 * | 300 * |
297 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a | 301 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a |
298 * WebSocket. | 302 * WebSocket. |
299 * | 303 * |
300 * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the | 304 * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the |
301 * connection is established, or called on an invalid resource, its data is | 305 * connection is established, its data is empty string. Return a |
302 * empty string. | 306 * <code>PP_VARTYPE_UNDEFINED</code> if called on an invalid resource. |
303 */ | 307 */ |
304 PP_Var GetURL([in] PP_Resource web_socket); | 308 PP_Var GetURL([in] PP_Resource web_socket); |
305 }; | 309 }; |
OLD | NEW |