summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi/ppb_websocket_impl.h
diff options
context:
space:
mode:
authortoyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-18 05:51:54 +0000
committertoyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-18 05:51:54 +0000
commit081d147b55170f80e74d4172a784e7fe19b063be (patch)
treeb123331bca55cc16f16cf6cf8260ea8a6b3c7bf7 /webkit/plugins/ppapi/ppb_websocket_impl.h
parent8bc0cd5093b498df67db690be98e37fa2d00c26a (diff)
downloadchromium_src-081d147b55170f80e74d4172a784e7fe19b063be.zip
chromium_src-081d147b55170f80e74d4172a784e7fe19b063be.tar.gz
chromium_src-081d147b55170f80e74d4172a784e7fe19b063be.tar.bz2
- Implement internal API and thunk
- Implement base frame for in process API - Add basic unit tests for in process API BUG=87310 TEST=ui_tests --gtest_filter="PPAPITest.WebSocket*" Review URL: http://codereview.chromium.org/8571002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110664 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi/ppb_websocket_impl.h')
-rw-r--r--webkit/plugins/ppapi/ppb_websocket_impl.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/webkit/plugins/ppapi/ppb_websocket_impl.h b/webkit/plugins/ppapi/ppb_websocket_impl.h
new file mode 100644
index 0000000..a966171
--- /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() OVERRIDE;
+
+ // PPB_WebSocket_API implementation.
+ virtual int32_t Connect(PP_Var url,
+ const PP_Var protocols[],
+ uint32_t protocol_count,
+ PP_CompletionCallback callback) OVERRIDE;
+ virtual int32_t Close(uint16_t code,
+ PP_Var reason,
+ PP_CompletionCallback callback) OVERRIDE;
+ virtual int32_t ReceiveMessage(PP_Var* message,
+ PP_CompletionCallback callbac) OVERRIDE;
+ virtual int32_t SendMessage(PP_Var message) OVERRIDE;
+ virtual uint64_t GetBufferedAmount() OVERRIDE;
+ virtual uint16_t GetCloseCode() OVERRIDE;
+ virtual PP_Var GetCloseReason() OVERRIDE;
+ virtual PP_Bool GetCloseWasClean() OVERRIDE;
+ virtual PP_Var GetExtensions() OVERRIDE;
+ virtual PP_Var GetProtocol() OVERRIDE;
+ virtual PP_WebSocketReadyState_Dev GetReadyState() OVERRIDE;
+ virtual PP_Var GetURL() OVERRIDE;
+
+ DISALLOW_COPY_AND_ASSIGN(PPB_WebSocket_Impl);
+};
+
+} // namespace ppapi
+} // namespace webkit
+
+#endif // WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_