Home | History | Annotate | Download | only in c

Lines Matching full:code

2  * Use of this source code is governed by a BSD-style license that can be
24 * This file defines the <code>PPB_WebSocket</code> interface providing
67 * <code>PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE</code> and codes in the range
68 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN</code> to
69 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX</code>, and
70 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN</code> to
71 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX</code> are valid for Close().
75 * Indicates to request closing connection without status code and reason.
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
104 * Status code 1004 is reserved.
107 * Pseudo code to indicate that receiving close frame doesn't contain any
108 * status code.
112 * Pseudo code to indicate that connection was closed abnormally, e.g.,
148 * Pseudo code to indicate that the connection was closed due to a failure to
179 * The <code>PPB_WebSocket</code> interface provides bi-directional,
186 * @param[in] instance A <code>PP_Instance</code> identifying the instance
189 * @return A <code>PP_Resource</code> corresponding to a WebSocket if
194 * IsWebSocket() determines if the provided <code>resource</code> is a
197 * @param[in] resource A <code>PP_Resource</code> corresponding to a
200 * @return Returns <code>PP_TRUE</code> if <code>resource</code> is a
201 * <code>PPB_WebSocket</code>, <code>PP_FALSE</code> if the
202 * <code>resource</code> is invalid or some type other than
203 * <code>PPB_WebSocket</code>.
208 * function once for a <code>web_socket</code>.
210 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a
213 * @param[in] url A <code>PP_Var</code> representing a WebSocket server URL.
214 * The <code>PP_VarType</code> must be <code>PP_VARTYPE_STRING</code>.
216 * @param[in] protocols A pointer to an array of <code>PP_Var</code>
217 * specifying sub-protocols. Each <code>PP_Var</code> represents one
218 * sub-protocol and its <code>PP_VarType</code> must be
219 * <code>PP_VARTYPE_STRING</code>. This argument can be null only if
220 * <code>protocol_count</code> is 0.
223 * <code>protocols</code>.
225 * @param[in] callback A <code>PP_CompletionCallback</code> called
229 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
230 * Returns <code>PP_ERROR_BADARGUMENT</code> if the specified
231 * <code>url</code>, or <code>protocols</code> contain an invalid string as
233 * <code>PP_ERROR_BADARGUMENT</code> corresponds to a SyntaxError in the
235 * Returns <code>PP_ERROR_NOACCESS</code> if the protocol specified in the
236 * <code>url</code> is not a secure protocol, but the origin of the caller
237 * has a secure scheme. Also returns <code>PP_ERROR_NOACCESS</code> if the
238 * port specified in the <code>url</code> is a port that the user agent
240 * SMTP. <code>PP_ERROR_NOACCESS</code> corresponds to a SecurityError of the
242 * Returns <code>PP_ERROR_INPROGRESS</code> if this is not the first call to
252 * <code>code</code> and <code>reason</code>.
254 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a
257 * @param[in] code The WebSocket close code. This is ignored if it is
258 * <code>PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED</code>.
259 * <code>PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE</code> must be used for the
261 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN</code> to
262 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX</code>, and in the range
263 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN</code> to
264 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX</code> are available.
266 * @param[in] reason A <code>PP_Var</code> representing the WebSocket
267 * close reason. This is ignored if it is <code>PP_VARTYPE_UNDEFINED</code>.
268 * Otherwise, its <code>PP_VarType</code> must be
269 * <code>PP_VARTYPE_STRING</code>.
271 * @param[in] callback A <code>PP_CompletionCallback</code> called
275 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
276 * Returns <code>PP_ERROR_BADARGUMENT</code> if <code>reason</code> contains
278 * <code>PP_ERROR_BADARGUMENT</code> corresponds to a JavaScript SyntaxError
280 * Returns <code>PP_ERROR_NOACCESS</code> if the code is not an integer
281 * equal to 1000 or in the range 3000 to 4999. <code>PP_ERROR_NOACCESS</code>
283 * Returns <code>PP_ERROR_INPROGRESS</code> if a previous call to Close() is
287 uint16_t code,
296 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a
300 * <code>message</code>. The <code>message</code> must remain valid until
301 * ReceiveMessage() completes. Its received <code>PP_VarType</code> will be
302 * <code>PP_VARTYPE_STRING</code> or <code>PP_VARTYPE_ARRAY_BUFFER</code>.
304 * @param[in] callback A <code>PP_CompletionCallback</code> called
306 * ReceiveMessage() completes synchronously and returns <code>PP_OK</code>.
308 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
310 * <code>PP_ERROR_FAILED</code> after all buffered messages are received.
312 * <code>PP_OK</code> as if connection is still established without errors.
320 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a
324 * buffer, so the caller can free <code>message</code> safely after returning
325 * from the function. Its sent <code>PP_VarType</code> must be
326 * <code>PP_VARTYPE_STRING</code> or <code>PP_VARTYPE_ARRAY_BUFFER</code>.
328 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
329 * Returns <code>PP_ERROR_FAILED</code> if the ReadyState is
330 * <code>PP_WEBSOCKETREADYSTATE_CONNECTING</code>.
331 * <code>PP_ERROR_FAILED</code> corresponds to a JavaScript
333 * Returns <code>PP_ERROR_BADARGUMENT</code> if the provided
334 * <code>message</code> contains an invalid character as a UTF-8 string.
335 * <code>PP_ERROR_BADARGUMENT</code> corresponds to a JavaScript
337 * Otherwise, returns <code>PP_OK</code>, which doesn't necessarily mean
346 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a
353 * GetCloseCode() returns the connection close code for the WebSocket
356 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a
359 * @return Returns 0 if called before the close code is set.
366 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a
369 * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the
371 * <code>PP_VARTYPE_UNDEFINED</code> if called on an invalid resource.
378 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a
381 * @return Returns <code>PP_FALSE</code> if called before the connection is
383 * Otherwise, returns <code>PP_TRUE</code> if the connection was closed
391 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a
394 * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the
396 * <code>PP_VARTYPE_UNDEFINED</code> if called on an invalid resource.
403 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a
406 * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the
408 * <code>PP_VARTYPE_UNDEFINED</code> if called on an invalid resource.
415 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a
418 * @return Returns <code>PP_WEBSOCKETREADYSTATE_INVALID</code> if called
426 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a
429 * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the
431 * <code>PP_VARTYPE_UNDEFINED</code> if this function is called on an