| OLD | NEW |
| 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 /* From ppb_websocket.idl modified Wed Apr 25 11:48:30 2012. */ | 6 /* From ppb_websocket.idl modified Wed May 16 17:05:41 2012. */ |
| 7 | 7 |
| 8 #ifndef PPAPI_C_PPB_WEBSOCKET_H_ | 8 #ifndef PPAPI_C_PPB_WEBSOCKET_H_ |
| 9 #define PPAPI_C_PPB_WEBSOCKET_H_ | 9 #define PPAPI_C_PPB_WEBSOCKET_H_ |
| 10 | 10 |
| 11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
| 12 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
| 13 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
| 14 #include "ppapi/c/pp_macros.h" | 14 #include "ppapi/c/pp_macros.h" |
| 15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
| 16 #include "ppapi/c/pp_stdint.h" | 16 #include "ppapi/c/pp_stdint.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 * GetCloseCode(). Refer to RFC 6455, The WebSocket Protocol, for further | 65 * GetCloseCode(). Refer to RFC 6455, The WebSocket Protocol, for further |
| 66 * information. | 66 * information. |
| 67 * <code>PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE</code> and codes in the range | 67 * <code>PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE</code> and codes in the range |
| 68 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN</code> to | 68 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN</code> to |
| 69 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX</code>, and | 69 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX</code>, and |
| 70 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN</code> to | 70 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN</code> to |
| 71 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX</code> are valid for Close(). | 71 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX</code> are valid for Close(). |
| 72 */ | 72 */ |
| 73 typedef enum { | 73 typedef enum { |
| 74 /** | 74 /** |
| 75 * Indicates to request closing connection without status code and reasom. |
| 76 * The code 1005 is forbidden to send in actual close frames by the RFC. |
| 77 * PP_WebSocket reuses this code internally and the code will never appear in |
| 78 * the actual close frames. |
| 79 */ |
| 80 PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED = 1005, |
| 81 /** |
| 75 * Status codes in the range 0-999 are not used. | 82 * Status codes in the range 0-999 are not used. |
| 76 */ | 83 */ |
| 77 /** | 84 /** |
| 78 * Indicates a normal closure. | 85 * Indicates a normal closure. |
| 79 */ | 86 */ |
| 80 PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE = 1000, | 87 PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE = 1000, |
| 81 /** | 88 /** |
| 82 * Indicates that an endpoint is "going away", such as a server going down. | 89 * Indicates that an endpoint is "going away", such as a server going down. |
| 83 */ | 90 */ |
| 84 PP_WEBSOCKETSTATUSCODE_GOING_AWAY = 1001, | 91 PP_WEBSOCKETSTATUSCODE_GOING_AWAY = 1001, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 * IANA. | 157 * IANA. |
| 151 */ | 158 */ |
| 152 PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN = 3000, | 159 PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN = 3000, |
| 153 PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX = 3999, | 160 PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX = 3999, |
| 154 /** | 161 /** |
| 155 * Status codes in the range 4000-4999 are reserved for private use. | 162 * Status codes in the range 4000-4999 are reserved for private use. |
| 156 * Application can use these codes for application specific purposes freely. | 163 * Application can use these codes for application specific purposes freely. |
| 157 */ | 164 */ |
| 158 PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN = 4000, | 165 PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN = 4000, |
| 159 PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX = 4999 | 166 PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX = 4999 |
| 160 } PP_WebSocketCloseCode; | 167 } PP_WebSocketStatusCode; |
| 161 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_WebSocketCloseCode, 4); | 168 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_WebSocketStatusCode, 4); |
| 162 /** | 169 /** |
| 163 * @} | 170 * @} |
| 164 */ | 171 */ |
| 165 | 172 |
| 166 /** | 173 /** |
| 167 * @addtogroup Interfaces | 174 * @addtogroup Interfaces |
| 168 * @{ | 175 * @{ |
| 169 */ | 176 */ |
| 170 /** | 177 /** |
| 171 * The <code>PPB_WebSocket</code> interface provides bi-directional, | 178 * The <code>PPB_WebSocket</code> interface provides bi-directional, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 const struct PP_Var protocols[], | 246 const struct PP_Var protocols[], |
| 240 uint32_t protocol_count, | 247 uint32_t protocol_count, |
| 241 struct PP_CompletionCallback callback); | 248 struct PP_CompletionCallback callback); |
| 242 /** | 249 /** |
| 243 * Close() closes the specified WebSocket connection by specifying | 250 * Close() closes the specified WebSocket connection by specifying |
| 244 * <code>code</code> and <code>reason</code>. | 251 * <code>code</code> and <code>reason</code>. |
| 245 * | 252 * |
| 246 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a | 253 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a |
| 247 * WebSocket. | 254 * WebSocket. |
| 248 * | 255 * |
| 249 * @param[in] code The WebSocket close code. This is ignored if it is 0. | 256 * @param[in] code The WebSocket close code. This is ignored if it is |
| 257 * <code>PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED</code>. |
| 250 * <code>PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE</code> must be used for the | 258 * <code>PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE</code> must be used for the |
| 251 * usual case. To indicate some specific error cases, codes in the range | 259 * usual case. To indicate some specific error cases, codes in the range |
| 252 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN</code> to | 260 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN</code> to |
| 253 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX</code>, and in the range | 261 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX</code>, and in the range |
| 254 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN</code> to | 262 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN</code> to |
| 255 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX</code> are available. | 263 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX</code> are available. |
| 256 * | 264 * |
| 257 * @param[in] reason A <code>PP_Var</code> representing the WebSocket | 265 * @param[in] reason A <code>PP_Var</code> representing the WebSocket |
| 258 * close reason. This is ignored if it is <code>PP_VARTYPE_UNDEFINED</code>. | 266 * close reason. This is ignored if it is <code>PP_VARTYPE_UNDEFINED</code>. |
| 259 * Otherwise, its <code>PP_VarType</code> must be | 267 * Otherwise, its <code>PP_VarType</code> must be |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 struct PP_Var (*GetURL)(PP_Resource web_socket); | 433 struct PP_Var (*GetURL)(PP_Resource web_socket); |
| 426 }; | 434 }; |
| 427 | 435 |
| 428 typedef struct PPB_WebSocket_1_0 PPB_WebSocket; | 436 typedef struct PPB_WebSocket_1_0 PPB_WebSocket; |
| 429 /** | 437 /** |
| 430 * @} | 438 * @} |
| 431 */ | 439 */ |
| 432 | 440 |
| 433 #endif /* PPAPI_C_PPB_WEBSOCKET_H_ */ | 441 #endif /* PPAPI_C_PPB_WEBSOCKET_H_ */ |
| 434 | 442 |
| OLD | NEW |