Commit 2f3c7a92 authored by toyoshim@chromium.org's avatar toyoshim@chromium.org

[Chromium][WebSocket] Remove binary communication using WebData in WebKit API

https://bugs.webkit.org/show_bug.cgi?id=76608

Reviewed by Darin Fisher.

* public/WebSocket.h: Remove BinaryTypeData definition and sendBinary(const WebData&).
* public/WebSocketClient.h: Remove didReceiveBinaryData(const WebData&).
* src/WebSocketImpl.cpp: Remove WebData related code and set default binary type as BinaryTypeBlob.
(WebKit::WebSocketImpl::WebSocketImpl): Remove sendBinary(const WebData&).
(WebKit::WebSocketImpl::didReceiveBinaryData): Remove WebData supporting code.
* src/WebSocketImpl.h: Remove sendBinary(const WebData&).


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105675 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d9061f86
2012-01-23 Takashi Toyoshima <toyoshim@chromium.org>
[Chromium][WebSocket] Remove binary communication using WebData in WebKit API
https://bugs.webkit.org/show_bug.cgi?id=76608
Reviewed by Darin Fisher.
* public/WebSocket.h: Remove BinaryTypeData definition and sendBinary(const WebData&).
* public/WebSocketClient.h: Remove didReceiveBinaryData(const WebData&).
* src/WebSocketImpl.cpp: Remove WebData related code and set default binary type as BinaryTypeBlob.
(WebKit::WebSocketImpl::WebSocketImpl): Remove sendBinary(const WebData&).
(WebKit::WebSocketImpl::didReceiveBinaryData): Remove WebData supporting code.
* src/WebSocketImpl.h: Remove sendBinary(const WebData&).
2012-01-23 James Robinson <jamesr@chromium.org>
[chromium] Add <(SHARED_INTERMEDIATE_DIR)/webkit to include path of targets that depend on WebKit API so they pick up the copied headers in an onion build
......
......@@ -39,7 +39,6 @@ namespace WebCore { class WebSocketChannel; }
namespace WebKit {
class WebArrayBuffer;
class WebData;
class WebDocument;
class WebString;
class WebURL;
......@@ -61,11 +60,9 @@ public:
CloseEventCodeMaximumUserDefined = 4999
};
// FIXME: Remove BinaryTypeData after a switchover to other types.
enum BinaryType {
BinaryTypeBlob = 0,
BinaryTypeArrayBuffer = 1,
BinaryTypeData = 2 // Don't use it
BinaryTypeArrayBuffer = 1
};
WEBKIT_EXPORT static WebSocket* create(const WebDocument&, WebSocketClient*);
......@@ -75,8 +72,8 @@ public:
// specification. It specifies binary object type for receiving binary
// frames representation. Receiving text frames are always mapped to
// WebString type regardless of this attribute.
// Default type must be BinaryTypeBlob, but currently is BinaryTypeData
// for a switchover from WebData to WebArrayBuffer.
// Default type is BinaryTypeBlob. But currently it is not supported.
// Set BinaryTypeArrayBuffer here ahead of using binary communication.
// See also, The WebSocket API - http://www.w3.org/TR/websockets/ .
virtual BinaryType binaryType() const = 0;
virtual bool setBinaryType(BinaryType) = 0;
......@@ -84,7 +81,6 @@ public:
virtual void connect(const WebURL&, const WebString& protocol) = 0;
virtual WebString subprotocol() = 0;
virtual bool sendText(const WebString&) = 0;
virtual bool sendBinary(const WebData&) = 0;
virtual bool sendArrayBuffer(const WebArrayBuffer&) = 0;
virtual unsigned long bufferedAmount() const = 0;
virtual void close(int code, const WebString& reason) = 0;
......
......@@ -32,7 +32,6 @@
#define WebSocketClient_h
#include "platform/WebCommon.h"
#include "platform/WebData.h"
namespace WebKit {
......@@ -49,7 +48,6 @@ public:
virtual ~WebSocketClient() { }
virtual void didConnect() { }
virtual void didReceiveMessage(const WebString& message) { }
virtual void didReceiveBinaryData(const WebData& binaryData) { }
virtual void didReceiveArrayBuffer(const WebArrayBuffer& arrayBuffer) { }
virtual void didReceiveMessageError() { }
virtual void didUpdateBufferedAmount(unsigned long bufferedAmount) { }
......
......@@ -47,7 +47,6 @@ class WebSocketChannel {
#include "WebArrayBuffer.h"
#include "WebDocument.h"
#include "WebSocketClient.h"
#include "platform/WebData.h"
#include "platform/WebString.h"
#include "platform/WebURL.h"
......@@ -55,10 +54,9 @@ using namespace WebCore;
namespace WebKit {
// FIXME: Default m_binaryType must be Blob after supporting WebBlob.
WebSocketImpl::WebSocketImpl(const WebDocument& document, WebSocketClient* client)
: m_client(client)
, m_binaryType(BinaryTypeData)
, m_binaryType(BinaryTypeBlob)
{
#if ENABLE(WEB_SOCKETS)
m_private = WebSocketChannel::create(PassRefPtr<Document>(document).get(), this);
......@@ -116,15 +114,6 @@ bool WebSocketImpl::sendText(const WebString& message)
#endif
}
bool WebSocketImpl::sendBinary(const WebData& binaryData)
{
#if ENABLE(WEB_SOCKETS)
return m_private->send(binaryData.data(), binaryData.size());
#else
ASSERT_NOT_REACHED();
#endif
}
bool WebSocketImpl::sendArrayBuffer(const WebArrayBuffer& webArrayBuffer)
{
#if ENABLE(WEB_SOCKETS)
......@@ -193,9 +182,8 @@ void WebSocketImpl::didReceiveBinaryData(PassOwnPtr<Vector<char> > binaryData)
{
#if ENABLE(WEB_SOCKETS)
switch (m_binaryType) {
case BinaryTypeData:
case BinaryTypeBlob: // FIXME: Handle Blob after supporting WebBlob.
m_client->didReceiveBinaryData(WebData(binaryData->data(), binaryData->size()));
case BinaryTypeBlob:
// FIXME: Handle Blob after supporting WebBlob.
break;
case BinaryTypeArrayBuffer:
m_client->didReceiveArrayBuffer(WebArrayBuffer(ArrayBuffer::create(binaryData->data(), binaryData->size())));
......
......@@ -42,7 +42,6 @@ namespace WebCore { class WebSocketChannel; }
namespace WebKit {
class WebData;
class WebDocument;
class WebString;
class WebURL;
......@@ -59,8 +58,6 @@ public:
virtual void connect(const WebURL&, const WebString& protocol);
virtual WebString subprotocol();
virtual bool sendText(const WebString&);
// FIXME: Remove sendBinary() after a switchover to other types.
virtual bool sendBinary(const WebData&);
virtual bool sendArrayBuffer(const WebArrayBuffer&);
virtual unsigned long bufferedAmount() const;
virtual void close(int code, const WebString& reason);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment