| 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_THUNK_WEBSOCKET_API_H_ | 5 #ifndef PPAPI_THUNK_WEBSOCKET_API_H_ |
| 6 #define PPAPI_THUNK_WEBSOCKET_API_H_ | 6 #define PPAPI_THUNK_WEBSOCKET_API_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_completion_callback.h" | 8 #include "ppapi/c/pp_completion_callback.h" |
| 9 #include "ppapi/c/ppb_websocket.h" | 9 #include "ppapi/c/ppb_websocket.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // Connects to the specified WebSocket server with |protocols| argument | 22 // Connects to the specified WebSocket server with |protocols| argument |
| 23 // defined by the WebSocket API. Returns an int32_t error code from | 23 // defined by the WebSocket API. Returns an int32_t error code from |
| 24 // pp_errors.h. | 24 // pp_errors.h. |
| 25 virtual int32_t Connect(PP_Var url, | 25 virtual int32_t Connect(PP_Var url, |
| 26 const PP_Var protocols[], | 26 const PP_Var protocols[], |
| 27 uint32_t protocol_count, | 27 uint32_t protocol_count, |
| 28 PP_CompletionCallback callback) = 0; | 28 PP_CompletionCallback callback) = 0; |
| 29 | 29 |
| 30 // Closes the established connection with specified |code| and |reason|. | 30 // Closes the established connection with specified |code| and |reason|. |
| 31 // Returns an int32_t error code from pp_errors.h. | 31 // Returns an int32_t error code from pp_errors.h. |
| 32 virtual int32_t Close(uint16_t code, | 32 virtual int32_t Close(PP_WebSocketStatusCode code, |
| 33 PP_Var reason, | 33 PP_Var reason, |
| 34 PP_CompletionCallback callback) = 0; | 34 PP_CompletionCallback callback) = 0; |
| 35 | 35 |
| 36 // Receives a message from the WebSocket server. Caller must keep specified | 36 // Receives a message from the WebSocket server. Caller must keep specified |
| 37 // |message| object as valid until completion callback is invoked. Returns an | 37 // |message| object as valid until completion callback is invoked. Returns an |
| 38 // int32_t error code from pp_errors.h. | 38 // int32_t error code from pp_errors.h. |
| 39 virtual int32_t ReceiveMessage(PP_Var* message, | 39 virtual int32_t ReceiveMessage(PP_Var* message, |
| 40 PP_CompletionCallback callback) = 0; | 40 PP_CompletionCallback callback) = 0; |
| 41 | 41 |
| 42 // Sends a message to the WebSocket server. Returns an int32_t error code | 42 // Sends a message to the WebSocket server. Returns an int32_t error code |
| (...skipping 27 matching lines...) Expand all Loading... |
| 70 virtual PP_WebSocketReadyState GetReadyState() = 0; | 70 virtual PP_WebSocketReadyState GetReadyState() = 0; |
| 71 | 71 |
| 72 // Returns the url attribute of The WebSocket API. | 72 // Returns the url attribute of The WebSocket API. |
| 73 virtual PP_Var GetURL() = 0; | 73 virtual PP_Var GetURL() = 0; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace thunk | 76 } // namespace thunk |
| 77 } // namespace ppapi | 77 } // namespace ppapi |
| 78 | 78 |
| 79 #endif // PPAPI_THUNK_WEBSOCKET_API_H_ | 79 #endif // PPAPI_THUNK_WEBSOCKET_API_H_ |
| OLD | NEW |