script: Pass &mut JSContext to FetchResponseListener::process_response (#43259)

Add the cx parameter to `fn process_response` in the
`FetchResponseListener` trait and the traits that that interface change
requires. Chose to add it as the first parameter, following the same
order that `FetchResponseListener::process_response_eof` uses.

Testing: Checked that servo builds locally as well as `./mach fmt` and
`./mach test-tidy`. I don't think more tests are needed as we are not
introducing new functionality
Fixes: #42840

---------

Signed-off-by: Javier Olaechea <pirata@gmail.com>
This commit is contained in:
Javier Olaechea
2026-03-19 01:22:00 -05:00
committed by GitHub
parent 8215118a12
commit eea60b8eb1
20 changed files with 85 additions and 36 deletions

View File

@@ -341,7 +341,12 @@ impl FetchResponseListener for ClassicContext {
// TODO(KiChjang): Perhaps add custom steps to perform fetch here?
fn process_request_eof(&mut self, _: RequestId) {}
fn process_response(&mut self, _: RequestId, metadata: Result<FetchMetadata, NetworkError>) {
fn process_response(
&mut self,
_: &mut js::context::JSContext,
_: RequestId,
metadata: Result<FetchMetadata, NetworkError>,
) {
self.metadata = metadata.ok().map(|meta| {
self.response_was_cors_cross_origin = meta.is_cors_cross_origin();
match meta {