Chromium Code Reviews| Index: webkit/plugins/ppapi/ppb_websocket_impl.h |
| diff --git a/webkit/plugins/ppapi/ppb_websocket_impl.h b/webkit/plugins/ppapi/ppb_websocket_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3734f886dadebdc66a7d9239f30033600a3b9e48 |
| --- /dev/null |
| +++ b/webkit/plugins/ppapi/ppb_websocket_impl.h |
| @@ -0,0 +1,53 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_ |
| +#define WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_ |
| + |
| +#include "ppapi/shared_impl/resource.h" |
| +#include "ppapi/thunk/ppb_websocket_api.h" |
| + |
| +namespace webkit { |
| +namespace ppapi { |
| + |
| +// All implementation is in this class for now. We should move some common |
| +// implementation to shared_impl when we implement proxy interfaces. |
| +class PPB_WebSocket_Impl : public ::ppapi::Resource, |
| + public ::ppapi::thunk::PPB_WebSocket_API { |
| + public: |
| + explicit PPB_WebSocket_Impl(PP_Instance instance); |
| + virtual ~PPB_WebSocket_Impl(); |
| + |
| + static PP_Resource Create(PP_Instance instance); |
| + |
| + // Resource overrides. |
| + 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.
|
| + |
| + // PPB_WebSocket_API implementation. |
| + virtual int32_t Connect(PP_Var url, |
| + const PP_Var protocols[], |
| + uint32_t protocol_count, |
| + PP_CompletionCallback callback); |
| + virtual int32_t Close(uint16_t code, |
| + PP_Var reason, |
| + PP_CompletionCallback callback); |
| + virtual int32_t ReceiveMessage(PP_Var* message, |
| + PP_CompletionCallback callbac); |
| + virtual int32_t SendMessage(PP_Var message); |
| + virtual uint64_t GetBufferedAmount(); |
| + virtual uint16_t GetCloseCode(); |
| + virtual PP_Var GetCloseReason(); |
| + virtual PP_Bool GetCloseWasClean(); |
| + virtual PP_Var GetExtensions(); |
| + virtual PP_Var GetProtocol(); |
| + virtual PP_WebSocketReadyState_Dev GetReadyState(); |
| + virtual PP_Var GetURL(); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(PPB_WebSocket_Impl); |
| +}; |
| + |
| +} // namespace ppapi |
| +} // namespace webkit |
| + |
| +#endif // WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_ |