mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:37:46 +00:00
LibWeb: Fix a few const-ness issues
This commit is contained in:
parent
70a2ca7fc0
commit
c0b2fa74ac
36 changed files with 123 additions and 121 deletions
|
@ -97,7 +97,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Infrastructure::FetchController>> fetch(JS:
|
|||
// response consume body is processResponseConsumeBody, process response end-of-body is processResponseEndOfBody,
|
||||
// task destination is taskDestination, and cross-origin isolated capability is crossOriginIsolatedCapability.
|
||||
auto fetch_params = Infrastructure::FetchParams::create(vm, request, timing_info);
|
||||
fetch_params->set_algorithms(move(algorithms));
|
||||
fetch_params->set_algorithms(algorithms);
|
||||
if (task_destination)
|
||||
fetch_params->set_task_destination({ *task_destination });
|
||||
fetch_params->set_cross_origin_isolated_capability(cross_origin_isolated_capability);
|
||||
|
@ -506,7 +506,7 @@ WebIDL::ExceptionOr<Optional<JS::NonnullGCPtr<PendingResponse>>> main_fetch(JS::
|
|||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#fetch-finale
|
||||
WebIDL::ExceptionOr<void> fetch_response_handover(JS::Realm& realm, Infrastructure::FetchParams const& fetch_params, Infrastructure::Response const& response)
|
||||
WebIDL::ExceptionOr<void> fetch_response_handover(JS::Realm& realm, Infrastructure::FetchParams const& fetch_params, Infrastructure::Response& response)
|
||||
{
|
||||
dbgln_if(WEB_FETCH_DEBUG, "Fetch: Running 'fetch response handover' with: fetch_params @ {}, response @ {}", &fetch_params, &response);
|
||||
|
||||
|
@ -958,7 +958,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_fetch(JS::Realm& rea
|
|||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#concept-http-redirect-fetch
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_redirect_fetch(JS::Realm& realm, Infrastructure::FetchParams const& fetch_params, Infrastructure::Response const& response)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_redirect_fetch(JS::Realm& realm, Infrastructure::FetchParams const& fetch_params, Infrastructure::Response& response)
|
||||
{
|
||||
dbgln_if(WEB_FETCH_DEBUG, "Fetch: Running 'HTTP-redirect fetch' with: fetch_params @ {}, response = {}", &fetch_params, &response);
|
||||
|
||||
|
@ -1103,7 +1103,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_network_or_cache_fet
|
|||
auto request = fetch_params.request();
|
||||
|
||||
// 2. Let httpFetchParams be null.
|
||||
JS::GCPtr<Infrastructure::FetchParams> http_fetch_params;
|
||||
JS::GCPtr<Infrastructure::FetchParams const> http_fetch_params;
|
||||
|
||||
// 3. Let httpRequest be null.
|
||||
JS::GCPtr<Infrastructure::Request> http_request;
|
||||
|
@ -1151,11 +1151,12 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_network_or_cache_fet
|
|||
|
||||
// 2. Set httpFetchParams to a copy of fetchParams.
|
||||
// 3. Set httpFetchParams’s request to httpRequest.
|
||||
http_fetch_params = Infrastructure::FetchParams::create(vm, *http_request, fetch_params.timing_info());
|
||||
http_fetch_params->set_algorithms(fetch_params.algorithms());
|
||||
http_fetch_params->set_task_destination(fetch_params.task_destination());
|
||||
http_fetch_params->set_cross_origin_isolated_capability(fetch_params.cross_origin_isolated_capability());
|
||||
http_fetch_params->set_preloaded_response_candidate(fetch_params.preloaded_response_candidate());
|
||||
auto new_http_fetch_params = Infrastructure::FetchParams::create(vm, *http_request, fetch_params.timing_info());
|
||||
new_http_fetch_params->set_algorithms(fetch_params.algorithms());
|
||||
new_http_fetch_params->set_task_destination(fetch_params.task_destination());
|
||||
new_http_fetch_params->set_cross_origin_isolated_capability(fetch_params.cross_origin_isolated_capability());
|
||||
new_http_fetch_params->set_preloaded_response_candidate(fetch_params.preloaded_response_candidate());
|
||||
http_fetch_params = new_http_fetch_params;
|
||||
}
|
||||
|
||||
// 3. Let includeCredentials be true if one of
|
||||
|
@ -1678,7 +1679,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> nonstandard_resource_load
|
|||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#cors-preflight-fetch-0
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> cors_preflight_fetch(JS::Realm& realm, Infrastructure::Request const& request)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> cors_preflight_fetch(JS::Realm& realm, Infrastructure::Request& request)
|
||||
{
|
||||
dbgln_if(WEB_FETCH_DEBUG, "Fetch: Running 'CORS-preflight fetch' with request @ {}", &request);
|
||||
|
||||
|
|
|
@ -31,12 +31,11 @@ ENUMERATE_BOOL_PARAMS
|
|||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Infrastructure::FetchController>> fetch(JS::Realm&, Infrastructure::Request&, Infrastructure::FetchAlgorithms const&, UseParallelQueue use_parallel_queue = UseParallelQueue::No);
|
||||
WebIDL::ExceptionOr<Optional<JS::NonnullGCPtr<PendingResponse>>> main_fetch(JS::Realm&, Infrastructure::FetchParams const&, Recursive recursive = Recursive::No);
|
||||
WebIDL::ExceptionOr<void> fetch_response_handover(JS::Realm&, Infrastructure::FetchParams const&, Infrastructure::Response const&);
|
||||
WebIDL::ExceptionOr<void> fetch_response_handover(JS::Realm&, Infrastructure::FetchParams const&, Infrastructure::Response&);
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> scheme_fetch(JS::Realm&, Infrastructure::FetchParams const&);
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_fetch(JS::Realm&, Infrastructure::FetchParams const&, MakeCORSPreflight make_cors_preflight = MakeCORSPreflight::No);
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_redirect_fetch(JS::Realm&, Infrastructure::FetchParams const&, Infrastructure::Response const&);
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_redirect_fetch(JS::Realm&, Infrastructure::FetchParams const&, Infrastructure::Response&);
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_network_or_cache_fetch(JS::Realm&, Infrastructure::FetchParams const&, IsAuthenticationFetch is_authentication_fetch = IsAuthenticationFetch::No, IsNewConnectionFetch is_new_connection_fetch = IsNewConnectionFetch::No);
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> nonstandard_resource_loader_http_network_fetch(JS::Realm&, Infrastructure::FetchParams const&, IncludeCredentials include_credentials = IncludeCredentials::No, IsNewConnectionFetch is_new_connection_fetch = IsNewConnectionFetch::No);
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> cors_preflight_fetch(JS::Realm&, Infrastructure::Request const&);
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> cors_preflight_fetch(JS::Realm&, Infrastructure::Request&);
|
||||
}
|
||||
|
|
|
@ -34,8 +34,8 @@ public:
|
|||
[[nodiscard]] JS::NonnullGCPtr<FetchController> controller() const { return m_controller; }
|
||||
[[nodiscard]] JS::NonnullGCPtr<FetchTimingInfo> timing_info() const { return m_timing_info; }
|
||||
|
||||
[[nodiscard]] JS::NonnullGCPtr<FetchAlgorithms> algorithms() const { return m_algorithms; }
|
||||
void set_algorithms(JS::NonnullGCPtr<FetchAlgorithms> algorithms) { m_algorithms = algorithms; }
|
||||
[[nodiscard]] JS::NonnullGCPtr<FetchAlgorithms const> algorithms() const { return m_algorithms; }
|
||||
void set_algorithms(JS::NonnullGCPtr<FetchAlgorithms const> algorithms) { m_algorithms = algorithms; }
|
||||
|
||||
[[nodiscard]] TaskDestination& task_destination() { return m_task_destination; }
|
||||
[[nodiscard]] TaskDestination const& task_destination() const { return m_task_destination; }
|
||||
|
@ -74,7 +74,7 @@ private:
|
|||
// https://fetch.spec.whatwg.org/#fetch-params-process-response-consume-body
|
||||
// process response consume body (default null)
|
||||
// Null or an algorithm.
|
||||
JS::NonnullGCPtr<FetchAlgorithms> m_algorithms;
|
||||
JS::NonnullGCPtr<FetchAlgorithms const> m_algorithms;
|
||||
|
||||
// https://fetch.spec.whatwg.org/#fetch-params-task-destination
|
||||
// task destination (default null)
|
||||
|
|
|
@ -116,7 +116,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Request>> Request::construct_impl(JS::Realm
|
|||
auto base_url = HTML::relevant_settings_object(*request_object).api_base_url();
|
||||
|
||||
// 4. Let signal be null.
|
||||
DOM::AbortSignal const* input_signal = nullptr;
|
||||
DOM::AbortSignal* input_signal = nullptr;
|
||||
|
||||
// 5. If input is a string, then:
|
||||
if (input.has<String>()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue