Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(961)

Unified Diff: ppapi/thunk/ppb_websocket_thunk.cc

Issue 8989046: WebSocket Pepper API: add interfaces to handle binaryType attribute (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix reviewed points Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/thunk/ppb_websocket_api.h ('k') | webkit/plugins/ppapi/ppb_websocket_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/thunk/ppb_websocket_thunk.cc
diff --git a/ppapi/thunk/ppb_websocket_thunk.cc b/ppapi/thunk/ppb_websocket_thunk.cc
index da93901779eeb1df3114bebaac831b93788bd417..1f49c3e3de793eac3c81e1eedd48a77446dd934f 100644
--- a/ppapi/thunk/ppb_websocket_thunk.cc
+++ b/ppapi/thunk/ppb_websocket_thunk.cc
@@ -124,8 +124,22 @@ PP_Var GetURL(PP_Resource resource) {
return enter.object()->GetURL();
}
+PP_Bool SetBinaryType(PP_Resource resource,
+ PP_WebSocketBinaryType_Dev binary_type) {
+ EnterResource<PPB_WebSocket_API> enter(resource, false);
+ if (enter.failed())
+ return PP_FALSE;
+ return enter.object()->SetBinaryType(binary_type);
+}
-const PPB_WebSocket_Dev g_ppb_websocket_thunk = {
+PP_WebSocketBinaryType_Dev GetBinaryType(PP_Resource resource) {
+ EnterResource<PPB_WebSocket_API> enter(resource, false);
+ if (enter.failed())
+ return PP_WEBSOCKETBINARYTYPE_INVALID;
+ return enter.object()->GetBinaryType();
+}
+
+const PPB_WebSocket_Dev_0_1 g_ppb_websocket_0_1_thunk = {
&Create,
&IsWebSocket,
&Connect,
@@ -142,10 +156,33 @@ const PPB_WebSocket_Dev g_ppb_websocket_thunk = {
&GetURL
};
+const PPB_WebSocket_Dev_0_9 g_ppb_websocket_0_9_thunk = {
+ &Create,
+ &IsWebSocket,
+ &Connect,
+ &Close,
+ &ReceiveMessage,
+ &SendMessage,
+ &GetBufferedAmount,
+ &GetCloseCode,
+ &GetCloseReason,
+ &GetCloseWasClean,
+ &GetExtensions,
+ &GetProtocol,
+ &GetReadyState,
+ &GetURL,
+ &SetBinaryType,
+ &GetBinaryType
+};
+
} // namespace
const PPB_WebSocket_Dev_0_1* GetPPB_WebSocket_Dev_0_1_Thunk() {
- return &g_ppb_websocket_thunk;
+ return &g_ppb_websocket_0_1_thunk;
+}
+
+const PPB_WebSocket_Dev_0_9* GetPPB_WebSocket_Dev_0_9_Thunk() {
+ return &g_ppb_websocket_0_9_thunk;
}
} // namespace thunk
« no previous file with comments | « ppapi/thunk/ppb_websocket_api.h ('k') | webkit/plugins/ppapi/ppb_websocket_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698