Skip to content
Permalink
Browse files
[Curl] Implement WebSocketTask
https://bugs.webkit.org/show_bug.cgi?id=237579

Reviewed by Alex Christensen.

Implement WebSocketTask for curl platforms. Use the SocketProvider to create the
WebSocketChannel. Update web socket expectations based on the WebSocketTask
implementation.

* LayoutTests/platform/wincairo/TestExpectations:
* Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp:
* Source/WebKit/NetworkProcess/WebSocketTask.h:
* Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp:
* Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.h:
* Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.cpp: Added.
* Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.h: Added.
* Source/WebKit/PlatformPlayStation.cmake:
* Source/WebKit/PlatformWin.cmake:

Canonical link: https://commits.webkit.org/251043@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294932 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
donny-dont committed May 27, 2022
1 parent 1fcc421 commit d726f6c8e4e517f224863044bb7200eeeac40127
Showing 9 changed files with 577 additions and 6 deletions.
@@ -886,14 +886,14 @@ http/tests/webshare [ Skip ]
http/tests/websocket/tests/hybi/contentextensions [ Skip ]

http/tests/websocket/tests/hybi/frame-lengths.html [ Pass Timeout ]
http/tests/websocket/tests/hybi/httponly-cookie.pl [ Pass Failure ]
http/tests/websocket/tests/hybi/inspector [ Skip ]
http/tests/websocket/tests/hybi/secure-cookie-insecure-connection.pl [ Pass Failure ]
http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl [ Pass Failure ]
http/tests/websocket/tests/hybi/upgrade-simple-ws.html [ Pass Failure ]

# [Win] Seeing Internal Server Error when running some http websocket tests
# https://bugs.webkit.org/show_bug.cgi?id=237722
http/tests/websocket/tests/hybi/websocket-allowed-setting-cookie-as-third-party.html [ Pass Failure ]
http/tests/websocket/tests/hybi/websocket-blocked-from-setting-cookie-as-third-party.html [ Pass Failure ]
http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html [ Pass Failure ]
http/tests/websocket/tests/hybi/workers/worker-reload.html [ Timeout Pass ]

# Needs curl download support
http/tests/workers/service/service-worker-download-async-delegates.https.html [ Failure Timeout ]
@@ -2009,7 +2009,6 @@ http/tests/misc/large-js-program.py [ Skip ] # Timeout
http/tests/misc/webtiming-one-redirect.py [ Failure ]
http/tests/misc/webtiming-two-redirects.py [ Failure ]
http/tests/performance/paint-timing/performance-paint-timing-fcp-after-visually-non-empty-for-style.html [ Timeout ]
http/tests/websocket/web-socket-loads-captured-in-per-page-domains.html [ Skip ] # Crash by assertion failure
http/tests/xmlhttprequest/access-control-basic-allow-list-request-headers.html [ Failure ]
http/tests/xmlhttprequest/chunked-progress-event-expectedLength.html [ Failure Timeout ]
http/tests/xmlhttprequest/origin-header-same-origin-get-async.html [ Failure ]
@@ -53,7 +53,7 @@ namespace WebCore {

Ref<ThreadableWebSocketChannel> ThreadableWebSocketChannel::create(Document& document, WebSocketChannelClient& client, SocketProvider& provider)
{
#if USE(SOUP)
#if USE(SOUP) || USE(CURL)
auto channel = provider.createWebSocketChannel(document, client);
ASSERT(channel);
return channel.releaseNonNull();
@@ -29,6 +29,8 @@
#include "WebSocketTaskCocoa.h"
#elif USE(SOUP)
#include "WebSocketTaskSoup.h"
#elif USE(CURL)
#include "WebSocketTaskCurl.h"
#else

#include "DataReference.h"
@@ -29,6 +29,7 @@
#include "NetworkProcess.h"
#include "NetworkSessionCreationParameters.h"
#include "WebCookieManager.h"
#include "WebSocketTaskCurl.h"
#include <WebCore/CookieJarDB.h>
#include <WebCore/CurlContext.h>
#include <WebCore/NetworkStorageSession.h>
@@ -58,4 +59,9 @@ NetworkSessionCurl::~NetworkSessionCurl()

}

std::unique_ptr<WebSocketTask> NetworkSessionCurl::createWebSocketTask(WebPageProxyIdentifier, NetworkSocketChannel& channel, const WebCore::ResourceRequest& request, const String& protocol, const WebCore::ClientOrigin&, bool)
{
return makeUnique<WebSocketTask>(channel, request, protocol);
}

} // namespace WebKit
@@ -39,6 +39,9 @@ class NetworkSessionCurl final : public NetworkSession {
}
NetworkSessionCurl(NetworkProcess&, const NetworkSessionCreationParameters&);
~NetworkSessionCurl();

private:
std::unique_ptr<WebSocketTask> createWebSocketTask(WebPageProxyIdentifier, NetworkSocketChannel&, const WebCore::ResourceRequest&, const String& protocol, const WebCore::ClientOrigin&, bool) final;
};

} // namespace WebKit

0 comments on commit d726f6c

Please sign in to comment.