mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user