summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibProtocol/WebSocketClient.cpp
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-05-03 13:55:29 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-03 21:14:40 +0200
commiteb21aa65d131f6fb382ad80d672e5a7ffb1a21e1 (patch)
tree674d52f397d8318941e97426b5100c18c8ac885f /Userland/Libraries/LibProtocol/WebSocketClient.cpp
parent5bb79ea0a79322d944368825ec617ccfb8912b81 (diff)
downloadserenity-eb21aa65d131f6fb382ad80d672e5a7ffb1a21e1.zip
Userland: Make IPC results with one return value available directly
This changes client methods so that they return the IPC response's return value directly - instead of the response struct - for IPC methods which only have a single return value.
Diffstat (limited to 'Userland/Libraries/LibProtocol/WebSocketClient.cpp')
-rw-r--r--Userland/Libraries/LibProtocol/WebSocketClient.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Userland/Libraries/LibProtocol/WebSocketClient.cpp b/Userland/Libraries/LibProtocol/WebSocketClient.cpp
index e8607d7e2b..4b07f2198d 100644
--- a/Userland/Libraries/LibProtocol/WebSocketClient.cpp
+++ b/Userland/Libraries/LibProtocol/WebSocketClient.cpp
@@ -25,8 +25,7 @@ RefPtr<WebSocket> WebSocketClient::connect(const URL& url, const String& origin,
IPC::Dictionary header_dictionary;
for (auto& it : request_headers)
header_dictionary.add(it.key, it.value);
- auto response = IPCProxy::connect(url, origin, protocols, extensions, header_dictionary);
- auto connection_id = response.connection_id();
+ auto connection_id = IPCProxy::connect(url, origin, protocols, extensions, header_dictionary);
if (connection_id < 0)
return nullptr;
auto connection = WebSocket::create_from_id({}, *this, connection_id);
@@ -38,7 +37,7 @@ u32 WebSocketClient::ready_state(Badge<WebSocket>, WebSocket& connection)
{
if (!m_connections.contains(connection.id()))
return (u32)WebSocket::ReadyState::Closed;
- return IPCProxy::ready_state(connection.id()).ready_state();
+ return IPCProxy::ready_state(connection.id());
}
void WebSocketClient::send(Badge<WebSocket>, WebSocket& connection, ByteBuffer data, bool is_text)
@@ -59,7 +58,7 @@ bool WebSocketClient::set_certificate(Badge<WebSocket>, WebSocket& connection, S
{
if (!m_connections.contains(connection.id()))
return false;
- return IPCProxy::set_certificate(connection.id(), move(certificate), move(key)).success();
+ return IPCProxy::set_certificate(connection.id(), move(certificate), move(key));
}
void WebSocketClient::connected(i32 connection_id)