| 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/dev/ppb_websocket_dev.h" | 9 #include "ppapi/c/ppb_websocket.h" |
| 10 | 10 |
| 11 namespace ppapi { | 11 namespace ppapi { |
| 12 namespace thunk { | 12 namespace thunk { |
| 13 | 13 |
| 14 class PPB_WebSocket_API { | 14 class PPB_WebSocket_API { |
| 15 public: | 15 public: |
| 16 virtual ~PPB_WebSocket_API() {} | 16 virtual ~PPB_WebSocket_API() {} |
| 17 | 17 |
| 18 virtual int32_t Connect(PP_Var url, | 18 virtual int32_t Connect(PP_Var url, |
| 19 const PP_Var protocols[], | 19 const PP_Var protocols[], |
| 20 uint32_t protocol_count, | 20 uint32_t protocol_count, |
| 21 PP_CompletionCallback callback) = 0; | 21 PP_CompletionCallback callback) = 0; |
| 22 virtual int32_t Close(uint16_t code, | 22 virtual int32_t Close(uint16_t code, |
| 23 PP_Var reason, | 23 PP_Var reason, |
| 24 PP_CompletionCallback callback) = 0; | 24 PP_CompletionCallback callback) = 0; |
| 25 virtual int32_t ReceiveMessage(PP_Var* message, | 25 virtual int32_t ReceiveMessage(PP_Var* message, |
| 26 PP_CompletionCallback callback) = 0; | 26 PP_CompletionCallback callback) = 0; |
| 27 virtual int32_t SendMessage(PP_Var message) = 0; | 27 virtual int32_t SendMessage(PP_Var message) = 0; |
| 28 virtual uint64_t GetBufferedAmount() = 0; | 28 virtual uint64_t GetBufferedAmount() = 0; |
| 29 virtual uint16_t GetCloseCode() = 0; | 29 virtual uint16_t GetCloseCode() = 0; |
| 30 virtual PP_Var GetCloseReason() = 0; | 30 virtual PP_Var GetCloseReason() = 0; |
| 31 virtual PP_Bool GetCloseWasClean() = 0; | 31 virtual PP_Bool GetCloseWasClean() = 0; |
| 32 virtual PP_Var GetExtensions() = 0; | 32 virtual PP_Var GetExtensions() = 0; |
| 33 virtual PP_Var GetProtocol() = 0; | 33 virtual PP_Var GetProtocol() = 0; |
| 34 virtual PP_WebSocketReadyState_Dev GetReadyState() = 0; | 34 virtual PP_WebSocketReadyState GetReadyState() = 0; |
| 35 virtual PP_Var GetURL() = 0; | 35 virtual PP_Var GetURL() = 0; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 } // namespace thunk | 38 } // namespace thunk |
| 39 } // namespace ppapi | 39 } // namespace ppapi |
| 40 | 40 |
| 41 #endif // PPAPI_THUNK_WEBSOCKET_API_H_ | 41 #endif // PPAPI_THUNK_WEBSOCKET_API_H_ |
| OLD | NEW |