WebSocketHandshake should not know about a Document
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Apr 2019 18:49:53 +0000 (18:49 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Apr 2019 18:49:53 +0000 (18:49 +0000)
commit3c32d401d41dee7e7c15883fa4738504d9a44f50
treefb9db0040eeca09b49e548ae85dd4bdbfbb988e8
parenta401c9c3b516920a0f0aaa03108b2b567856a33a
WebSocketHandshake should not know about a Document
https://bugs.webkit.org/show_bug.cgi?id=196468

Reviewed by Tim Horton.

I'll need to move WebSocketHandshake to the NetworkProcess for rdar://problem/46287028
It currently uses the Document pointer for 3 things:
1. To get the user agent, which we can pass in as a creation parameter.
2. To get the origin, which we can also pass in as a creation parameter.
3. To get cookies for the web inspector.  We can pass in a functor instead and have the inspector provide cookies itself.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::connect):
(WebCore::WebSocketChannel::disconnect):
(WebCore::WebSocketChannel::didOpenSocketStream):
(WebCore::WebSocketChannel::clientHandshakeRequest):
* Modules/websockets/WebSocketChannel.h:
(WebCore::WebSocketChannel::document):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::WebSocketHandshake):
(WebCore::WebSocketHandshake::clientHandshakeMessage const):
(WebCore::WebSocketHandshake::clientHandshakeRequest const):
(WebCore::WebSocketHandshake::clientOrigin const): Deleted.
(WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const): Deleted.
(WebCore::WebSocketHandshake::clearDocument): Deleted.
* Modules/websockets/WebSocketHandshake.h:
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::enable):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/websockets/WebSocketChannel.cpp
Source/WebCore/Modules/websockets/WebSocketChannel.h
Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
Source/WebCore/Modules/websockets/WebSocketHandshake.h
Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp