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(); | |
dmichael (off chromium)
2011/11/17 18:50:57
Please use OVERRIDE on all these virtual function
Takashi Toyoshima
2011/11/18 05:01:19
Done.
| |
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); | |
32 virtual int32_t Close(uint16_t code, | |
33 PP_Var reason, | |
34 PP_CompletionCallback callback); | |
35 virtual int32_t ReceiveMessage(PP_Var* message, | |
36 PP_CompletionCallback callbac); | |
37 virtual int32_t SendMessage(PP_Var message); | |
38 virtual uint64_t GetBufferedAmount(); | |
39 virtual uint16_t GetCloseCode(); | |
40 virtual PP_Var GetCloseReason(); | |
41 virtual PP_Bool GetCloseWasClean(); | |
42 virtual PP_Var GetExtensions(); | |
43 virtual PP_Var GetProtocol(); | |
44 virtual PP_WebSocketReadyState_Dev GetReadyState(); | |
45 virtual PP_Var GetURL(); | |
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 |