Lines Matching full:code
2 // Use of this source code is governed by a BSD-style license that can be
26 /// The <code>WebSocket</code> class providing bi-directional,
42 /// @param[in] url A <code>Var</code> of string type representing a WebSocket
45 /// @param[in] protocols A pointer to an array of <code>Var</code> of string
46 /// type specifying sub-protocols. Each <code>Var</code> represents one
48 /// <code>protocol_count</code> is 0.
51 /// <code>protocols</code>.
53 /// @param[in] callback A <code>CompletionCallback</code> called
57 /// @return An int32_t containing an error code from
58 /// <code>pp_errors.h</code>.
59 /// Returns <code>PP_ERROR_BADARGUMENT</code> if specified <code>url</code>,
60 /// or <code>protocols</code> contains invalid string as defined in
61 /// the WebSocket API specification. <code>PP_ERROR_BADARGUMENT</code>
63 /// Returns <code>PP_ERROR_NOACCESS</code> if the protocol specified in the
64 /// <code>url</code> is not a secure protocol, but the origin of the caller
65 /// has a secure scheme. Also returns <code>PP_ERROR_NOACCESS</code> if the
66 /// port specified in the <code>url</code> is a port that the user agent is
68 /// <code>PP_ERROR_NOACCESS</code> corresponds to a SecurityError of the
70 /// Returns <code>PP_ERROR_INPROGRESS</code> if this is not the first call to
76 /// <code>code</code> and <code>reason</code>.
78 /// @param[in] code The WebSocket close code. This is ignored if it is 0.
79 /// <code>PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE</code> must be used for the
81 /// <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN</code> to
82 /// <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX</code>, and in the range
83 /// <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN</code> to
84 /// <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX</code> are available.
86 /// @param[in] reason A <code>Var</code> of string type representing the
89 /// @param[in] callback A <code>CompletionCallback</code> called when the
92 /// @return An int32_t containing an error code from
93 /// <code>pp_errors.h</code>.
94 /// Returns <code>PP_ERROR_BADARGUMENT</code> if <code>reason</code> contains
96 /// <code>PP_ERROR_BADARGUMENT</code> corresponds to a JavaScript
98 /// Returns <code>PP_ERROR_NOACCESS</code> if the code is not an integer
100 /// <code>PP_ERROR_NOACCESS</code> corresponds to an InvalidAccessError in
101 /// the WebSocket API specification. Returns <code>PP_ERROR_INPROGRESS</code>
103 int32_t Close(uint16_t code, const Var& reason,
112 /// <code>message</code>. The <code>message</code> must remain valid until
113 /// ReceiveMessage() completes. Its received <code>Var</code> will be of
116 /// @param[in] callback A <code>CompletionCallback</code> called when
118 /// completes synchronously and returns <code>PP_OK</code>.
120 /// @return An int32_t containing an error code from
121 /// <code>pp_errors.h</code>.
123 /// <code>PP_ERROR_FAILED</code> after all buffered messages are received.
125 /// <code>PP_OK</code> as if connection is still established without errors.
132 /// buffer, so the caller can free <code>message</code> safely after returning
133 /// from the function. This <code>Var</code> must be of string or
136 /// @return An int32_t containing an error code from
137 /// <code>pp_errors.h</code>.
138 /// Returns <code>PP_ERROR_FAILED</code> if the ReadyState is
139 /// <code>PP_WEBSOCKETREADYSTATE_CONNECTING</code>.
140 /// <code>PP_ERROR_FAILED</code> corresponds to a JavaScript
142 /// Returns <code>PP_ERROR_BADARGUMENT</code> if the provided
143 /// <code>message</code> contains an invalid character as a
144 /// UTF-8 string. <code>PP_ERROR_BADARGUMENT</code> corresponds to a
146 /// Otherwise, returns <code>PP_OK</code>, but it doesn't necessarily mean
157 /// GetCloseCode() returns the connection close code for the WebSocket
160 /// @return Returns 0 if called before the close code is set.
166 /// @return Returns a <code>Var</code> of string type. If called before the
168 /// <code>PP_VARTYPE_UNDEFINED</code> if called on an invalid resource.
174 /// @return Returns <code>false</code> if called before the connection is
176 /// Otherwise, returns <code>true</code> if the connection was closed
183 /// @return Returns a <code>Var</code> of string type. If called before the
184 /// connection is established, the <code>Var</code>'s data is an empty
185 /// string. Returns a <code>PP_VARTYPE_UNDEFINED</code> if called on an
186 /// invalid resource. Currently the <code>Var</code>'s data for valid
193 /// @return Returns a <code>Var</code> of string type. If called before the
194 /// connection is established, the <code>Var</code> contains the empty
195 /// string. Returns a code>PP_VARTYPE_UNDEFINED</code> if called on an
202 /// @return Returns <code>PP_WEBSOCKETREADYSTATE_INVALID</code> if called
209 /// @return Returns a <code>Var</code> of string type. If called before the
210 /// connection is established, the <code>Var</code> contains the empty
211 /// string. Returns a <code>PP_VARTYPE_UNDEFINED</code> if this function