mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:27:43 +00:00
WebSocket: Avoid unnecessary IPC::Dictionary wrapper
We already have and use HashMap<DeprecatedString, DeprecatedString> nearly everywhere, which is equivalent.
This commit is contained in:
parent
9b9a38ec81
commit
d030f0fe9b
4 changed files with 8 additions and 8 deletions
|
@ -16,10 +16,10 @@ WebSocketClient::WebSocketClient(NonnullOwnPtr<Core::LocalSocket> socket)
|
|||
|
||||
RefPtr<WebSocket> WebSocketClient::connect(const URL& url, DeprecatedString const& origin, Vector<DeprecatedString> const& protocols, Vector<DeprecatedString> const& extensions, HashMap<DeprecatedString, DeprecatedString> const& request_headers)
|
||||
{
|
||||
IPC::Dictionary header_dictionary;
|
||||
for (auto& it : request_headers)
|
||||
header_dictionary.add(it.key, it.value);
|
||||
auto connection_id = IPCProxy::connect(url, origin, protocols, extensions, header_dictionary);
|
||||
auto headers_or_error = request_headers.clone();
|
||||
if (headers_or_error.is_error())
|
||||
return nullptr;
|
||||
auto connection_id = IPCProxy::connect(url, origin, protocols, extensions, headers_or_error.release_value());
|
||||
if (connection_id < 0)
|
||||
return nullptr;
|
||||
auto connection = WebSocket::create_from_id({}, *this, connection_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue