WebSocketChannel minor refactoring for code manageability
authortoyoshim@chromium.org <toyoshim@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2012 06:39:35 +0000 (06:39 +0000)
committertoyoshim@chromium.org <toyoshim@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2012 06:39:35 +0000 (06:39 +0000)
commit19d48636d7df5bfb8b71dfa5c1fcba4727f3c247
tree5b7534e33aaa9d2fe238edaf046ee8492ae77d50
parente7b16702463843575d13b99d92d74a2c06dd8573
WebSocketChannel minor refactoring for code manageability
https://bugs.webkit.org/show_bug.cgi?id=78576

Reviewed by Kent Tamura.

Change the first argument type of WebSocketChannel
from ScriptExecutionContext to Document.
WebSocketChannel always assume this ScriptExecutionContext must
inherit Document. Then, it results in many static cast.
It isn't readable and dangerous against future code changes.

* websockets/ThreadableWebSocketChannel.cpp: Pass the first argument for WebSocketChannel as Document.
(WebCore::ThreadableWebSocketChannel::create):
* websockets/WebSocketChannel.cpp: Replace all ScriptExecutionContext* m_context descriptions to Document* m_document.
(WebCore::WebSocketChannel::WebSocketChannel):
(WebCore::WebSocketChannel::connect):
(WebCore::WebSocketChannel::fail):
(WebCore::WebSocketChannel::disconnect):
(WebCore::WebSocketChannel::didOpenSocketStream):
(WebCore::WebSocketChannel::didCloseSocketStream):
(WebCore::WebSocketChannel::didReceiveSocketStreamData):
(WebCore::WebSocketChannel::didFailSocketStream):
(WebCore::WebSocketChannel::processBuffer):
(WebCore::WebSocketChannel::processOutgoingFrameQueue):
* websockets/WebSocketChannel.h: Change the first argument for construction to Document and hold it as Document m_document.
(WebCore):
(WebCore::WebSocketChannel::create):
(WebSocketChannel):
* websockets/WorkerThreadableWebSocketChannel.cpp: Pass the first argument for WebSocketChannel as Document.
(WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/websockets/ThreadableWebSocketChannel.cpp
Source/WebCore/websockets/WebSocketChannel.cpp
Source/WebCore/websockets/WebSocketChannel.h
Source/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp