OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_ |
| 7 |
| 8 #include "ppapi/shared_impl/resource.h" |
| 9 #include "ppapi/thunk/ppb_websocket_api.h" |
| 10 |
| 11 namespace webkit { |
| 12 namespace ppapi { |
| 13 |
| 14 // All implementation is in this class for now. We should move some common |
| 15 // implementation to shared_impl when we implement proxy interfaces. |
| 16 class PPB_WebSocket_Impl : public ::ppapi::Resource, |
| 17 public ::ppapi::thunk::PPB_WebSocket_API { |
| 18 public: |
| 19 explicit PPB_WebSocket_Impl(PP_Instance instance); |
| 20 virtual ~PPB_WebSocket_Impl(); |
| 21 |
| 22 static PP_Resource Create(PP_Instance instance); |
| 23 |
| 24 // Resource overrides. |
| 25 virtual ::ppapi::thunk::PPB_WebSocket_API* AsPPB_WebSocket_API() OVERRIDE; |
| 26 |
| 27 // PPB_WebSocket_API implementation. |
| 28 virtual int32_t Connect(PP_Var url, |
| 29 const PP_Var protocols[], |
| 30 uint32_t protocol_count, |
| 31 PP_CompletionCallback callback) OVERRIDE; |
| 32 virtual int32_t Close(uint16_t code, |
| 33 PP_Var reason, |
| 34 PP_CompletionCallback callback) OVERRIDE; |
| 35 virtual int32_t ReceiveMessage(PP_Var* message, |
| 36 PP_CompletionCallback callbac) OVERRIDE; |
| 37 virtual int32_t SendMessage(PP_Var message) OVERRIDE; |
| 38 virtual uint64_t GetBufferedAmount() OVERRIDE; |
| 39 virtual uint16_t GetCloseCode() OVERRIDE; |
| 40 virtual PP_Var GetCloseReason() OVERRIDE; |
| 41 virtual PP_Bool GetCloseWasClean() OVERRIDE; |
| 42 virtual PP_Var GetExtensions() OVERRIDE; |
| 43 virtual PP_Var GetProtocol() OVERRIDE; |
| 44 virtual PP_WebSocketReadyState_Dev GetReadyState() OVERRIDE; |
| 45 virtual PP_Var GetURL() OVERRIDE; |
| 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(PPB_WebSocket_Impl); |
| 48 }; |
| 49 |
| 50 } // namespace ppapi |
| 51 } // namespace webkit |
| 52 |
| 53 #endif // WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_ |
OLD | NEW |