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
5 files changed