script: Pass &mut JSContext in FetchResponseListener::process_response_eof (#42729)

`process_response_eof` is the only method that needs cx at least right
now. This PR removes one temp_cx and introduces one, removing that one
will is hard (needs VirtualMethods and a lot of work)

Testing: Just refactor
Part of #40600

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Sam
2026-02-20 17:03:21 +01:00
committed by GitHub
parent 0bc3b61a74
commit 9f1e5d084e
20 changed files with 89 additions and 53 deletions

View File

@@ -446,6 +446,7 @@ impl FetchResponseListener for PosterFrameFetchContext {
fn process_response_eof(
self,
cx: &mut js::context::JSContext,
request_id: RequestId,
response: Result<(), NetworkError>,
timing: ResourceFetchTiming,
@@ -454,7 +455,7 @@ impl FetchResponseListener for PosterFrameFetchContext {
self.id,
FetchResponseMsg::ProcessResponseEOF(request_id, response.clone(), timing.clone()),
);
network_listener::submit_timing(&self, &response, &timing, CanGc::note());
network_listener::submit_timing(&self, &response, &timing, CanGc::from_cx(cx));
}
fn process_csp_violations(&mut self, _request_id: RequestId, violations: Vec<Violation>) {