[Chromium] [WebSocket] export WebSocketChannel interface for plugins
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Nov 2011 07:19:57 +0000 (07:19 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Nov 2011 07:19:57 +0000 (07:19 +0000)
commitdb7d79f644abd1d7dc36df1e011c0eade5e69a0d
tree16b2593327f4fcea87a81d7fee6d1ec5518f3b21
parent10a86d88b7505a37b4d8f4fabec03dca670c4388
[Chromium] [WebSocket] export WebSocketChannel interface for plugins
https://bugs.webkit.org/show_bug.cgi?id=72016

Source/WebCore:

Patch by Takashi Toyoshima <toyoshim@chromium.org> on 2011-11-18
Reviewed by Darin Fisher.

Add a interface to send raw binary data.
This interface is used by WebWebSocketChannel implementation
in WebKit API.

No new tests because just export a interface.

* websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::send):
* websockets/WebSocketChannel.h:

Source/WebKit/chromium:

Add WebSocket and WebSocketClient to WebKit API.

Currently, only WebSocketStreamHandle class is exported to WebKit API.
WebSocketStreamHandle implements bi-directional communication ports.
If plugins handles the WebSocket protocol, WebSocketChannel and
WebSocketChannelClient must be exported as WebSocket because they are
the classes which implement the WebSocket protocol stack.

Normally, we use WebWebSocketChannel and WebWebSocketChannelClient as
their class names. But here we use just WebSocket and WebSocketClient
because of avoiding WebWeb prefix and class name confliction on
header include.

Patch by Takashi Toyoshima <toyoshim@chromium.org> on 2011-11-18
Reviewed by Darin Fisher.

* WebKit.gyp:
* public/WebSocket.h: Added.
(WebKit::WebSocket::~WebSocket):
* public/WebSocketClient.h: Added.
(WebKit::WebSocketClient::~WebSocketClient):
* src/WebRuntimeFeatures.cpp: Insert websockets directory to include path in order to avoid filename confliction.
(WebKit::WebRuntimeFeatures::enableSockets): Use WebCore namespace explicitly.
* src/WebSocket.cpp: Added.
(WebKit::WebSocket::create):
* src/WebSocketImpl.cpp: Added.
(WebKit::WebSocketImpl::WebSocketImpl):
(WebKit::WebSocketImpl::~WebSocketImpl):
(WebKit::WebSocketImpl::connect):
(WebKit::WebSocketImpl::subprotocol):
(WebKit::WebSocketImpl::sendText):
(WebKit::WebSocketImpl::sendBinary):
(WebKit::WebSocketImpl::bufferedAmount):
(WebKit::WebSocketImpl::close):
(WebKit::WebSocketImpl::fail):
(WebKit::WebSocketImpl::disconnect):
(WebKit::WebSocketImpl::didConnect):
(WebKit::WebSocketImpl::didReceiveMessage):
(WebKit::WebSocketImpl::didReceiveBinaryData):
(WebKit::WebSocketImpl::didReceiveMessageError):
(WebKit::WebSocketImpl::didStartClosingHandshake):
(WebKit::WebSocketImpl::didClose):
* src/WebSocketImpl.h: Added.
(WebKit::WebSocketImpl::isNull):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100849 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/websockets/WebSocketChannel.cpp
Source/WebCore/websockets/WebSocketChannel.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gyp
Source/WebKit/chromium/public/WebSocket.h [new file with mode: 0644]
Source/WebKit/chromium/public/WebSocketClient.h [new file with mode: 0644]
Source/WebKit/chromium/src/WebRuntimeFeatures.cpp
Source/WebKit/chromium/src/WebSocket.cpp [new file with mode: 0644]
Source/WebKit/chromium/src/WebSocketImpl.cpp [new file with mode: 0644]
Source/WebKit/chromium/src/WebSocketImpl.h [new file with mode: 0644]