RequestServer: Enable in Windows CI

This commit is contained in:
ayeteadoe 2025-06-28 03:24:38 -07:00 committed by Andrew Kaster
parent c7f35193d0
commit 58be9e6400
5 changed files with 31 additions and 13 deletions

View File

@ -14,15 +14,15 @@
namespace Requests {
struct RequestTimingInfo {
long domain_lookup_start_microseconds { 0 };
long domain_lookup_end_microseconds { 0 };
long connect_start_microseconds { 0 };
long connect_end_microseconds { 0 };
long secure_connect_start_microseconds { 0 };
long request_start_microseconds { 0 };
long response_start_microseconds { 0 };
long response_end_microseconds { 0 };
long encoded_body_size { 0 };
i64 domain_lookup_start_microseconds { 0 };
i64 domain_lookup_end_microseconds { 0 };
i64 connect_start_microseconds { 0 };
i64 connect_end_microseconds { 0 };
i64 secure_connect_start_microseconds { 0 };
i64 request_start_microseconds { 0 };
i64 response_start_microseconds { 0 };
i64 response_end_microseconds { 0 };
i64 encoded_body_size { 0 };
ALPNHttpVersion http_version_alpn_identifier { ALPNHttpVersion::None };
};

View File

@ -45,8 +45,9 @@ ErrorOr<BrowserProcess::ProcessDisposition> BrowserProcess::connect(Vector<ByteS
return ProcessDisposition::ContinueMainProcess;
}
ErrorOr<void> BrowserProcess::connect_as_client(ByteString const& socket_path, Vector<ByteString> const& raw_urls, NewWindow new_window)
ErrorOr<void> BrowserProcess::connect_as_client([[maybe_unused]] ByteString const& socket_path, [[maybe_unused]] Vector<ByteString> const& raw_urls, [[maybe_unused]] NewWindow new_window)
{
#if !defined(AK_OS_WINDOWS)
// TODO: Mach IPC
auto socket = TRY(Core::LocalSocket::connect(socket_path));
auto client = UIProcessClient::construct(make<IPC::Transport>(move(socket)));
@ -60,10 +61,14 @@ ErrorOr<void> BrowserProcess::connect_as_client(ByteString const& socket_path, V
}
return {};
#else
return Error::from_string_literal("BrowserProcess::connect_as_client() is not implemented on Windows");
#endif
}
ErrorOr<void> BrowserProcess::connect_as_server(ByteString const& socket_path)
ErrorOr<void> BrowserProcess::connect_as_server([[maybe_unused]] ByteString const& socket_path)
{
#if !defined(AK_OS_WINDOWS)
// TODO: Mach IPC
auto socket_fd = TRY(Process::create_ipc_socket(socket_path));
m_socket_path = socket_path;
@ -85,6 +90,9 @@ ErrorOr<void> BrowserProcess::connect_as_server(ByteString const& socket_path)
};
return {};
#else
return Error::from_string_literal("BrowserProcess::connect_as_server() is not implemented on Windows");
#endif
}
BrowserProcess::~BrowserProcess()

View File

@ -71,10 +71,14 @@ static NonnullRefPtr<Resolver> default_resolver()
};
}
#if !defined(AK_OS_WINDOWS)
return DNS::Resolver::SocketResult {
MaybeOwned<Core::Socket>(TRY(Core::BufferedUDPSocket::create(TRY(Core::UDPSocket::connect(*g_dns_info.server_address))))),
DNS::Resolver::ConnectionMode::UDP,
};
#else
return Error::from_string_literal("Core::UDPSocket::connect() and Core::BufferedUDPSocket::create() are not implemented on Windows");
#endif
});
s_resolver = resolver;
@ -356,7 +360,7 @@ void ConnectionFromClient::die()
Messages::RequestServer::InitTransportResponse ConnectionFromClient::init_transport([[maybe_unused]] int peer_pid)
{
#ifdef AK_OS_WINDOWS
m_transport.set_peer_pid(peer_pid);
m_transport->set_peer_pid(peer_pid);
return Core::System::getpid();
#endif
VERIFY_NOT_REACHED();

View File

@ -6,8 +6,11 @@
#include "ConnectionFromClient.h"
#include <AK/Windows.h>
#include <RequestServer/WebSocketImplCurl.h>
#include <curl/curl.h>
namespace RequestServer {
NonnullRefPtr<WebSocketImplCurl> WebSocketImplCurl::create(CURLM* multi_handle)

View File

@ -9,7 +9,10 @@
#include <AK/MemoryStream.h>
#include <LibCore/Forward.h>
#include <LibWebSocket/Impl/WebSocketImpl.h>
#include <curl/curl.h>
typedef void CURL;
typedef void CURLM;
struct curl_slist;
namespace RequestServer {