mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
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:
@@ -486,6 +486,7 @@ impl FetchResponseListener for LinkFetchContext {
|
||||
/// and step 3.1 of <https://html.spec.whatwg.org/multipage/#link-type-preload:fetch-and-process-the-linked-resource-2>
|
||||
fn process_response_eof(
|
||||
mut self,
|
||||
cx: &mut js::context::JSContext,
|
||||
_: RequestId,
|
||||
response_result: Result<(), NetworkError>,
|
||||
timing: ResourceFetchTiming,
|
||||
@@ -519,7 +520,7 @@ impl FetchResponseListener for LinkFetchContext {
|
||||
);
|
||||
}
|
||||
|
||||
submit_timing(&self, &response_result, &timing, CanGc::note());
|
||||
submit_timing(&self, &response_result, &timing, CanGc::from_cx(cx));
|
||||
|
||||
// Step 11.6. If processResponse is given, then call processResponse with response.
|
||||
//
|
||||
@@ -530,7 +531,7 @@ impl FetchResponseListener for LinkFetchContext {
|
||||
// Part of Prefetch
|
||||
if let Some(link) = self.link.as_ref() {
|
||||
link.root()
|
||||
.fire_event_after_response(response_result, CanGc::note());
|
||||
.fire_event_after_response(response_result, CanGc::from_cx(cx));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user