diff options
author | Max Wipfli <mail@maxwipfli.ch> | 2021-06-05 11:59:04 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-06 16:00:11 +0200 |
commit | 30cdebfa9ef1c466484de997391b66f742f4b85b (patch) | |
tree | 86e52ebbd55135d4e27701b9a6bd341c36232c3e /Userland/Libraries/LibProtocol | |
parent | 5b5f7bc360f3ec487ed6a21c350b7ca4ae165d17 (diff) | |
download | serenity-30cdebfa9ef1c466484de997391b66f742f4b85b.zip |
LibProtocol: Use URL class in RequestClient::start_request argument
This changes the RequestClient::start_request() method to take a URL
object instead of a URL string as argument. All callers of the method
already had a URL object anyway, and start_request() in turn parses the
URL string back into a URL object. This removes this unnecessary
conversion.
Diffstat (limited to 'Userland/Libraries/LibProtocol')
-rw-r--r-- | Userland/Libraries/LibProtocol/RequestClient.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibProtocol/RequestClient.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibProtocol/RequestClient.cpp b/Userland/Libraries/LibProtocol/RequestClient.cpp index bd88b07403..613c262223 100644 --- a/Userland/Libraries/LibProtocol/RequestClient.cpp +++ b/Userland/Libraries/LibProtocol/RequestClient.cpp @@ -16,7 +16,7 @@ RequestClient::RequestClient() } template<typename RequestHashMapTraits> -RefPtr<Request> RequestClient::start_request(String const& method, String const& url, HashMap<String, String, RequestHashMapTraits> const& request_headers, ReadonlyBytes request_body) +RefPtr<Request> RequestClient::start_request(String const& method, URL const& url, HashMap<String, String, RequestHashMapTraits> const& request_headers, ReadonlyBytes request_body) { IPC::Dictionary header_dictionary; for (auto& it : request_headers) @@ -82,5 +82,5 @@ void RequestClient::certificate_requested(i32 request_id) } -template RefPtr<Protocol::Request> Protocol::RequestClient::start_request(String const& method, String const& url, HashMap<String, String> const& request_headers, ReadonlyBytes request_body); -template RefPtr<Protocol::Request> Protocol::RequestClient::start_request(String const& method, String const& url, HashMap<String, String, CaseInsensitiveStringTraits> const& request_headers, ReadonlyBytes request_body); +template RefPtr<Protocol::Request> Protocol::RequestClient::start_request(String const& method, URL const&, HashMap<String, String> const& request_headers, ReadonlyBytes request_body); +template RefPtr<Protocol::Request> Protocol::RequestClient::start_request(String const& method, URL const&, HashMap<String, String, CaseInsensitiveStringTraits> const& request_headers, ReadonlyBytes request_body); diff --git a/Userland/Libraries/LibProtocol/RequestClient.h b/Userland/Libraries/LibProtocol/RequestClient.h index 9297daf5ec..7ad2a2fe24 100644 --- a/Userland/Libraries/LibProtocol/RequestClient.h +++ b/Userland/Libraries/LibProtocol/RequestClient.h @@ -22,7 +22,7 @@ class RequestClient final public: template<typename RequestHashMapTraits = Traits<String>> - RefPtr<Request> start_request(String const& method, String const& url, HashMap<String, String, RequestHashMapTraits> const& request_headers = {}, ReadonlyBytes request_body = {}); + RefPtr<Request> start_request(String const& method, URL const&, HashMap<String, String, RequestHashMapTraits> const& request_headers = {}, ReadonlyBytes request_body = {}); bool stop_request(Badge<Request>, Request&); bool set_certificate(Badge<Request>, Request&, String, String); |