1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:47:45 +00:00

Everywhere: Run clang-format

This commit is contained in:
Idan Horowitz 2022-04-01 20:58:27 +03:00 committed by Linus Groh
parent 0376c127f6
commit 086969277e
1665 changed files with 8479 additions and 8479 deletions

View file

@ -28,24 +28,24 @@ public:
const AK::URL& url() const { return m_url; }
void set_url(const AK::URL& url) { m_url = url; }
const String& method() const { return m_method; }
void set_method(const String& method) { m_method = method; }
String const& method() const { return m_method; }
void set_method(String const& method) { m_method = method; }
const ByteBuffer& body() const { return m_body; }
void set_body(const ByteBuffer& body) { m_body = body; }
ByteBuffer const& body() const { return m_body; }
void set_body(ByteBuffer const& body) { m_body = body; }
void start_timer() { m_load_timer.start(); };
Time load_time() const { return m_load_timer.elapsed_time(); }
unsigned hash() const
{
auto body_hash = string_hash((const char*)m_body.data(), m_body.size());
auto body_hash = string_hash((char const*)m_body.data(), m_body.size());
auto body_and_headers_hash = pair_int_hash(body_hash, m_headers.hash());
auto url_and_method_hash = pair_int_hash(m_url.to_string().hash(), m_method.hash());
return pair_int_hash(body_and_headers_hash, url_and_method_hash);
}
bool operator==(const LoadRequest& other) const
bool operator==(LoadRequest const& other) const
{
if (m_headers.size() != other.m_headers.size())
return false;
@ -59,10 +59,10 @@ public:
return m_url == other.m_url && m_method == other.m_method && m_body == other.m_body;
}
void set_header(const String& name, const String& value) { m_headers.set(name, value); }
String header(const String& name) const { return m_headers.get(name).value_or({}); }
void set_header(String const& name, String const& value) { m_headers.set(name, value); }
String header(String const& name) const { return m_headers.get(name).value_or({}); }
const HashMap<String, String>& headers() const { return m_headers; }
HashMap<String, String> const& headers() const { return m_headers; }
private:
AK::URL m_url;
@ -78,7 +78,7 @@ namespace AK {
template<>
struct Traits<Web::LoadRequest> : public GenericTraits<Web::LoadRequest> {
static unsigned hash(const Web::LoadRequest& request) { return request.hash(); }
static unsigned hash(Web::LoadRequest const& request) { return request.hash(); }
};
}