1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:17:35 +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

@ -50,7 +50,7 @@ void XMLHttpRequest::set_ready_state(ReadyState ready_state)
dispatch_event(DOM::Event::create(EventNames::readystatechange));
}
void XMLHttpRequest::fire_progress_event(const String& event_name, u64 transmitted, u64 length)
void XMLHttpRequest::fire_progress_event(String const& event_name, u64 transmitted, u64 length)
{
ProgressEventInit event_init {};
event_init.length_computable = true;
@ -371,7 +371,7 @@ Optional<MimeSniff::MimeType> XMLHttpRequest::extract_mime_type(HashMap<String,
}
// https://fetch.spec.whatwg.org/#forbidden-header-name
static bool is_forbidden_header_name(const String& header_name)
static bool is_forbidden_header_name(String const& header_name)
{
if (header_name.starts_with("Proxy-", CaseSensitivity::CaseInsensitive) || header_name.starts_with("Sec-", CaseSensitivity::CaseInsensitive))
return true;
@ -381,14 +381,14 @@ static bool is_forbidden_header_name(const String& header_name)
}
// https://fetch.spec.whatwg.org/#forbidden-method
static bool is_forbidden_method(const String& method)
static bool is_forbidden_method(String const& method)
{
auto lowercase_method = method.to_lowercase();
return lowercase_method.is_one_of("connect", "trace", "track");
}
// https://fetch.spec.whatwg.org/#concept-method-normalize
static String normalize_method(const String& method)
static String normalize_method(String const& method)
{
auto lowercase_method = method.to_lowercase();
if (lowercase_method.is_one_of("delete", "get", "head", "options", "post", "put"))
@ -397,14 +397,14 @@ static String normalize_method(const String& method)
}
// https://fetch.spec.whatwg.org/#concept-header-value-normalize
static String normalize_header_value(const String& header_value)
static String normalize_header_value(String const& header_value)
{
// FIXME: I'm not sure if this is the right trim, it should only be HTML whitespace bytes.
return header_value.trim_whitespace();
}
// https://xhr.spec.whatwg.org/#dom-xmlhttprequest-setrequestheader
DOM::ExceptionOr<void> XMLHttpRequest::set_request_header(const String& header, const String& value)
DOM::ExceptionOr<void> XMLHttpRequest::set_request_header(String const& header, String const& value)
{
if (m_ready_state != ReadyState::Opened)
return DOM::InvalidStateError::create("XHR readyState is not OPENED");
@ -424,7 +424,7 @@ DOM::ExceptionOr<void> XMLHttpRequest::set_request_header(const String& header,
}
// https://xhr.spec.whatwg.org/#dom-xmlhttprequest-open
DOM::ExceptionOr<void> XMLHttpRequest::open(const String& method, const String& url)
DOM::ExceptionOr<void> XMLHttpRequest::open(String const& method, String const& url)
{
// FIXME: Let settingsObject be thiss relevant settings object.

View file

@ -54,13 +54,13 @@ public:
DOM::ExceptionOr<JS::Value> response();
Bindings::XMLHttpRequestResponseType response_type() const { return m_response_type; }
DOM::ExceptionOr<void> open(const String& method, const String& url);
DOM::ExceptionOr<void> open(String const& method, String const& url);
DOM::ExceptionOr<void> send(String body);
DOM::ExceptionOr<void> set_request_header(const String& header, const String& value);
DOM::ExceptionOr<void> set_request_header(String const& header, String const& value);
void set_response_type(Bindings::XMLHttpRequestResponseType type) { m_response_type = type; }
String get_response_header(const String& name) { return m_response_headers.get(name).value_or({}); }
String get_response_header(String const& name) { return m_response_headers.get(name).value_or({}); }
String get_all_response_headers() const;
Bindings::CallbackType* onreadystatechange();
@ -75,7 +75,7 @@ private:
void set_ready_state(ReadyState);
void set_status(unsigned status) { m_status = status; }
void fire_progress_event(const String&, u64, u64);
void fire_progress_event(String const&, u64, u64);
MimeSniff::MimeType get_response_mime_type() const;
Optional<StringView> get_final_encoding() const;