LibWeb/Fetch: Remove redundant timingInfo variables

This is an editorial change in the Fetch spec.

See: https://github.com/whatwg/fetch/commit/e8b67b0
This commit is contained in:
Linus Groh 2022-12-07 19:16:37 +00:00
parent a06b97dae0
commit ae0606711c
Notes: sideshowbarker 2024-07-17 03:38:21 +09:00

View File

@ -752,10 +752,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_fetch(JS::Realm& rea
// 3. Let actualResponse be null.
JS::GCPtr<Infrastructure::Response> actual_response;
// 4. Let timingInfo be fetchParamss timing info.
// FIXME: This is unused (spec issue)
// 5. If requests service-workers mode is "all", then:
// 4. If requests service-workers mode is "all", then:
if (request->service_workers_mode() == Infrastructure::Request::ServiceWorkersMode::All) {
// 1. Let requestForServiceWorker be a clone of request.
auto request_for_service_worker = TRY(request->clone(vm));
@ -812,7 +809,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_fetch(JS::Realm& rea
JS::GCPtr<PendingResponse> pending_actual_response;
// 6. If response is null, then:
// 5. If response is null, then:
if (!response) {
// 1. If makeCORSPreflight is true and one of these conditions is true:
// NOTE: This step checks the CORS-preflight cache and if there is no suitable entry it performs a
@ -863,7 +860,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_fetch(JS::Realm& rea
request->set_timing_allow_failed(true);
}
// 7. If either requests response tainting or responses type is "opaque", and the cross-origin resource
// 6. If either requests response tainting or responses type is "opaque", and the cross-origin resource
// policy check with requests origin, requests client, requests destination, and actualResponse returns
// blocked, then return a network error.
// NOTE: The cross-origin resource policy check runs for responses coming from the network and responses coming
@ -878,7 +875,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_fetch(JS::Realm& rea
JS::GCPtr<PendingResponse> inner_pending_response;
// 8. If actualResponses status is a redirect status, then:
// 7. If actualResponses status is a redirect status, then:
if (Infrastructure::is_redirect_status(actual_response->status())) {
// FIXME: 1. If actualResponses status is not 303, requests body is not null, and the connection uses HTTP/2,
// then user agents may, and are even encouraged to, transmit an RST_STREAM frame.
@ -923,7 +920,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_fetch(JS::Realm& rea
}
});
// 9. Return response.
// 8. Return response.
// NOTE: Typically actualResponses bodys stream is still being enqueued to after returning.
return returned_pending_response;
}
@ -1332,9 +1329,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_network_or_cache_fet
// 24. If httpRequests cache mode is neither "no-store" nor "reload", then:
if (http_request->cache_mode() != Infrastructure::Request::CacheMode::NoStore
&& http_request->cache_mode() != Infrastructure::Request::CacheMode::Reload) {
// 1. Let timingInfo be fetchParamss timing info.
// FIXME: This is unused (spec issue)
// Set storedResponse to the result of selecting a response from the httpCache, possibly needing
// 1. Set storedResponse to the result of selecting a response from the httpCache, possibly needing
// validation, as per the "Constructing Responses from Caches" chapter of HTTP Caching [HTTP-CACHING],
// if any.
// NOTE: As mandated by HTTP, this still takes the `Vary` header into account.