Copy ServiceWorkerNavigationPreloader error when failing its ServiceWorkerFetchTask
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].
<rdar://problem/86263771>