script: Some failed requests should record resource timing entries (#41804)

Some failed requests should record resource timing entries

Testing: ./mach test-wpt
tests/wpt/tests/resource-timing/entries-for-network-errors.sub.https.html
Fixes: https://github.com/servo/servo/issues/41667

---------

Signed-off-by: bellau <laurent.belmonte@gmail.com>
This commit is contained in:
Laurent Belmonte
2026-01-14 14:20:12 +01:00
committed by GitHub
parent 77a1a2546c
commit 0dc28296e0
31 changed files with 182 additions and 212 deletions

View File

@@ -307,15 +307,14 @@ impl FetchResponseListener for ImageContext {
fn process_response_eof(
self,
request_id: RequestId,
response: Result<ResourceFetchTiming, NetworkError>,
response: Result<(), NetworkError>,
timing: ResourceFetchTiming,
) {
self.image_cache.notify_pending_response(
self.id,
FetchResponseMsg::ProcessResponseEOF(request_id, response.clone()),
FetchResponseMsg::ProcessResponseEOF(request_id, response.clone(), timing.clone()),
);
if let Ok(response) = response {
network_listener::submit_timing(&self, &response, CanGc::note());
}
network_listener::submit_timing(&self, &response, &timing, CanGc::note());
}
fn process_csp_violations(&mut self, _request_id: RequestId, violations: Vec<Violation>) {