Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(849)

Side by Side Diff: ppapi/c/ppb_websocket.h

Issue 10332138: WebSocket Pepper API: allow to close connection without code and reason (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert enum name change Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/api/ppb_websocket.idl ('k') | ppapi/tests/test_websocket.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 Thu May 31 15:47:38 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
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 reason.
76 *
77 * (Note that the code 1005 is forbidden to send in actual close frames by
78 * the RFC. PP_WebSocket reuses this code internally and the code will never
79 * appear in the actual close frames.)
80 */
81 PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED = 1005,
82 /**
75 * Status codes in the range 0-999 are not used. 83 * Status codes in the range 0-999 are not used.
76 */ 84 */
77 /** 85 /**
78 * Indicates a normal closure. 86 * Indicates a normal closure.
79 */ 87 */
80 PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE = 1000, 88 PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE = 1000,
81 /** 89 /**
82 * Indicates that an endpoint is "going away", such as a server going down. 90 * Indicates that an endpoint is "going away", such as a server going down.
83 */ 91 */
84 PP_WEBSOCKETSTATUSCODE_GOING_AWAY = 1001, 92 PP_WEBSOCKETSTATUSCODE_GOING_AWAY = 1001,
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 const struct PP_Var protocols[], 247 const struct PP_Var protocols[],
240 uint32_t protocol_count, 248 uint32_t protocol_count,
241 struct PP_CompletionCallback callback); 249 struct PP_CompletionCallback callback);
242 /** 250 /**
243 * Close() closes the specified WebSocket connection by specifying 251 * Close() closes the specified WebSocket connection by specifying
244 * <code>code</code> and <code>reason</code>. 252 * <code>code</code> and <code>reason</code>.
245 * 253 *
246 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a 254 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a
247 * WebSocket. 255 * WebSocket.
248 * 256 *
249 * @param[in] code The WebSocket close code. This is ignored if it is 0. 257 * @param[in] code The WebSocket close code. This is ignored if it is
258 * <code>PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED</code>.
250 * <code>PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE</code> must be used for the 259 * <code>PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE</code> must be used for the
251 * usual case. To indicate some specific error cases, codes in the range 260 * usual case. To indicate some specific error cases, codes in the range
252 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN</code> to 261 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN</code> to
253 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX</code>, and in the range 262 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX</code>, and in the range
254 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN</code> to 263 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN</code> to
255 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX</code> are available. 264 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX</code> are available.
256 * 265 *
257 * @param[in] reason A <code>PP_Var</code> representing the WebSocket 266 * @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>. 267 * close reason. This is ignored if it is <code>PP_VARTYPE_UNDEFINED</code>.
259 * Otherwise, its <code>PP_VarType</code> must be 268 * Otherwise, its <code>PP_VarType</code> must be
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 struct PP_Var (*GetURL)(PP_Resource web_socket); 434 struct PP_Var (*GetURL)(PP_Resource web_socket);
426 }; 435 };
427 436
428 typedef struct PPB_WebSocket_1_0 PPB_WebSocket; 437 typedef struct PPB_WebSocket_1_0 PPB_WebSocket;
429 /** 438 /**
430 * @} 439 * @}
431 */ 440 */
432 441
433 #endif /* PPAPI_C_PPB_WEBSOCKET_H_ */ 442 #endif /* PPAPI_C_PPB_WEBSOCKET_H_ */
434 443
OLDNEW
« no previous file with comments | « ppapi/api/ppb_websocket.idl ('k') | ppapi/tests/test_websocket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698