diff options
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/plugins/ppapi/ppb_websocket_impl.cc | 15 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_websocket_impl.h | 4 |
2 files changed, 18 insertions, 1 deletions
diff --git a/webkit/plugins/ppapi/ppb_websocket_impl.cc b/webkit/plugins/ppapi/ppb_websocket_impl.cc index ef2d6dd..00dd7f5 100644 --- a/webkit/plugins/ppapi/ppb_websocket_impl.cc +++ b/webkit/plugins/ppapi/ppb_websocket_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -75,9 +75,12 @@ bool InValidStateToReceive(PP_WebSocketReadyState_Dev state) { namespace webkit { namespace ppapi { +// TODO(toyoshim): Default value of binary_type_ must be +// PP_WEBSOCKETBINARYTYPE_BLOB_DEV after supporting Blob. PPB_WebSocket_Impl::PPB_WebSocket_Impl(PP_Instance instance) : Resource(instance), state_(PP_WEBSOCKETREADYSTATE_INVALID_DEV), + binary_type_(PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV), error_was_received_(false), receive_callback_var_(NULL), wait_for_receive_(false), @@ -419,6 +422,16 @@ PP_Var PPB_WebSocket_Impl::GetURL() { return url_->GetPPVar(); } +PP_Bool PPB_WebSocket_Impl::SetBinaryType( + PP_WebSocketBinaryType_Dev binary_type) { + // TODO(toyoshim): Use WebKit new API to set the receiving binary type. + return PP_FALSE; +} + +PP_WebSocketBinaryType_Dev PPB_WebSocket_Impl::GetBinaryType() { + return binary_type_; +} + void PPB_WebSocket_Impl::didConnect() { DCHECK_EQ(PP_WEBSOCKETREADYSTATE_CONNECTING_DEV, state_); state_ = PP_WEBSOCKETREADYSTATE_OPEN_DEV; diff --git a/webkit/plugins/ppapi/ppb_websocket_impl.h b/webkit/plugins/ppapi/ppb_websocket_impl.h index 16544f1..3177c7b 100644 --- a/webkit/plugins/ppapi/ppb_websocket_impl.h +++ b/webkit/plugins/ppapi/ppb_websocket_impl.h @@ -57,6 +57,9 @@ class PPB_WebSocket_Impl : public ::ppapi::Resource, virtual PP_Var GetProtocol() OVERRIDE; virtual PP_WebSocketReadyState_Dev GetReadyState() OVERRIDE; virtual PP_Var GetURL() OVERRIDE; + virtual PP_Bool SetBinaryType( + PP_WebSocketBinaryType_Dev binary_type) OVERRIDE; + virtual PP_WebSocketBinaryType_Dev GetBinaryType() OVERRIDE; // WebSocketClient implementation. virtual void didConnect(); @@ -74,6 +77,7 @@ class PPB_WebSocket_Impl : public ::ppapi::Resource, scoped_ptr<WebKit::WebSocket> websocket_; PP_WebSocketReadyState_Dev state_; + PP_WebSocketBinaryType_Dev binary_type_; bool error_was_received_; scoped_refptr< ::ppapi::TrackedCallback> connect_callback_; |