Summary: | Copy ServiceWorkerNavigationPreloader error when failing its ServiceWorkerFetchTask | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | youenn fablet <youennf> | ||||
Component: | Service Workers | Assignee: | youenn fablet <youennf> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | achristensen, cdumez, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
youenn fablet
2021-12-08 06:20:49 PST
Created attachment 446356 [details]
Patch
Comment on attachment 446356 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=446356&action=review > Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:370 > if (!m_preloader->error().isNull()) { Maybe this would look better? ``` if (auto error = m_preloader->error(); !error.isNull()) { didFail(error); return; } ``` > Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:397 > + didFail(ResourceError { m_preloader->error() }); ditto. Comment on attachment 446356 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=446356&action=review >> Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:370 >> if (!m_preloader->error().isNull()) { > > Maybe this would look better? > ``` > if (auto error = m_preloader->error(); !error.isNull()) { > didFail(error); > return; > } > ``` I am not sure, I would tend to leave the comment in any case. With your proposal, we would always copy the error, though a null error copy y is probably very cheap. Another approach is to return a ResourceError and not a const ResourceError&, or a std::optional<ResourceError>. Committed r286774 (245015@main): <https://commits.webkit.org/245015@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 446356 [details]. |