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 #ifndef PPAPI_CPP_WEBSOCKET_H_ | 5 #ifndef PPAPI_CPP_WEBSOCKET_H_ |
6 #define PPAPI_CPP_WEBSOCKET_H_ | 6 #define PPAPI_CPP_WEBSOCKET_H_ |
7 | 7 |
8 #include "ppapi/c/ppb_websocket.h" | 8 #include "ppapi/c/ppb_websocket.h" |
9 #include "ppapi/cpp/resource.h" | 9 #include "ppapi/cpp/resource.h" |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 /// @return An int32_t containing an error code from | 87 /// @return An int32_t containing an error code from |
88 /// <code>pp_errors.h</code>. | 88 /// <code>pp_errors.h</code>. |
89 /// Returns <code>PP_ERROR_BADARGUMENT</code> if <code>reason</code> contains | 89 /// Returns <code>PP_ERROR_BADARGUMENT</code> if <code>reason</code> contains |
90 /// an invalid character as a UTF-8 string, or is longer than 123 bytes. | 90 /// an invalid character as a UTF-8 string, or is longer than 123 bytes. |
91 /// <code>PP_ERROR_BADARGUMENT</code> corresponds to a JavaScript | 91 /// <code>PP_ERROR_BADARGUMENT</code> corresponds to a JavaScript |
92 /// SyntaxError in the WebSocket API specification. | 92 /// SyntaxError in the WebSocket API specification. |
93 /// Returns <code>PP_ERROR_NOACCESS</code> if the code is not an integer | 93 /// Returns <code>PP_ERROR_NOACCESS</code> if the code is not an integer |
94 /// equal to 1000 or in the range 3000 to 4999. | 94 /// equal to 1000 or in the range 3000 to 4999. |
95 /// <code>PP_ERROR_NOACCESS</code> corresponds to an InvalidAccessError in | 95 /// <code>PP_ERROR_NOACCESS</code> corresponds to an InvalidAccessError in |
96 /// the WebSocket API specification. Returns <code>PP_ERROR_INPROGRESS</code> | 96 /// the WebSocket API specification. Returns <code>PP_ERROR_INPROGRESS</code> |
97 /// if this is not the first call to Close(). | 97 /// if a previous call to Close() is not finished. |
98 int32_t Close(uint16_t code, const Var& reason, | 98 int32_t Close(uint16_t code, const Var& reason, |
99 const CompletionCallback& callback); | 99 const CompletionCallback& callback); |
100 | 100 |
101 /// ReceiveMessage() receives a message from the WebSocket server. | 101 /// ReceiveMessage() receives a message from the WebSocket server. |
102 /// This interface only returns a single message. That is, this interface | 102 /// This interface only returns a single message. That is, this interface |
103 /// must be called at least N times to receive N messages, no matter the size | 103 /// must be called at least N times to receive N messages, no matter the size |
104 /// of each message. | 104 /// of each message. |
105 /// | 105 /// |
106 /// @param[out] message The received message is copied to provided | 106 /// @param[out] message The received message is copied to provided |
107 /// <code>message</code>. The <code>message</code> must remain valid until | 107 /// <code>message</code>. The <code>message</code> must remain valid until |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 /// @return Returns a <code>Var</code> of string type. If called before the | 204 /// @return Returns a <code>Var</code> of string type. If called before the |
205 /// connection is established, the <code>Var</code> contains the empty | 205 /// connection is established, the <code>Var</code> contains the empty |
206 /// string. Returns a <code>PP_VARTYPE_UNDEFINED</code> if this function | 206 /// string. Returns a <code>PP_VARTYPE_UNDEFINED</code> if this function |
207 /// is called on an invalid resource. | 207 /// is called on an invalid resource. |
208 Var GetURL(); | 208 Var GetURL(); |
209 }; | 209 }; |
210 | 210 |
211 } // namespace pp | 211 } // namespace pp |
212 | 212 |
213 #endif // PPAPI_CPP_WEBSOCKET_H_ | 213 #endif // PPAPI_CPP_WEBSOCKET_H_ |
OLD | NEW |