Files
tubestation/dom/fetch
Eden Chuang d958745e90 Bug 1845317 - Propagate error response to Worker for PFetch before FetchDriver is created. r=dom-worker-reviewers,smaug
[[ https://searchfox.org/mozilla-central/rev/da1e39f50ef43145623938141c970437b226da9e/dom/fetch/FetchService.cpp#591 | fetch() in Workers when network is offline would returns a NetworkError response]], but this error response is not propagated through PFetch.

Before FetchInstance is created in the parent process, any errors should be propagated to the Worker.
This patch modifies the FetchService::NetworkErrorResponse() method to propagate the error to worker when PFetch is used.
To propagate the error, additional parameter FetchArgs is needed for FetchService::NetworkErrorResponse().
Since the propagation would only work when the FetchArgs is a WorkerFetchArgs, it gets a default parameter with UnknownArgs for other cases.
Here using UnknownArgs since it can meet errors while generating other types FetchArgs.

Differential Revision: https://phabricator.services.mozilla.com/D186125
2023-08-29 15:08:07 +00:00
..