RESOLVED FIXED 194651
Make ServiceWorkerClientFetch closer to WebResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=194651
Summary Make ServiceWorkerClientFetch closer to WebResourceLoader
youenn fablet
Reported 2019-02-14 07:53:40 PST
Now that service worker registrations are in the network process, we could consider serve service worker content through the regular network process loading code path. The first step is to make ServiceWorkerClientFetch closer to WebResourceLoader.
Attachments
Patch (51.29 KB, patch)
2019-02-14 08:33 PST, youenn fablet
no flags
Patch (50.42 KB, patch)
2019-02-14 15:02 PST, youenn fablet
no flags
Patch for landing (50.61 KB, patch)
2019-02-15 11:54 PST, youenn fablet
no flags
Patch (1.25 KB, patch)
2019-02-15 12:42 PST, youenn fablet
no flags
youenn fablet
Comment 1 2019-02-14 08:33:10 PST
youenn fablet
Comment 2 2019-02-14 15:02:53 PST
Alex Christensen
Comment 3 2019-02-15 10:49:12 PST
Comment on attachment 362067 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=362067&action=review > Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp:220 > + }, WorkerRunLoop::defaultMode()); Could we make this a default parameter? > Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.h:65 > + void didReceiveRedirectResponse(WebCore::ResourceResponse&&); Do we want to just inform that a redirect happened, or will we in the future have a need for the service worker to be able to reject the redirect? > Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:201 > + auto formData = WTFMove(m_formData); > + didReceiveFormDataAndFinish(formData.releaseNonNull()); Could we just call m_formData.releaseNonNull() without WTFMove? > Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:86 > + RefPtr<WebCore::SharedBuffer> m_buffer; > + RefPtr<FormData> m_formData; Can these be a Variant, or could we have more than one of these? > Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:88 > + Optional<ResourceError> m_error; Making this a std::unique_ptr would save memory in the common case.
youenn fablet
Comment 4 2019-02-15 11:54:49 PST
Created attachment 362140 [details] Patch for landing
youenn fablet
Comment 5 2019-02-15 11:56:39 PST
Thanks for the review. (In reply to Alex Christensen from comment #3) > Comment on attachment 362067 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=362067&action=review > > > Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp:220 > > + }, WorkerRunLoop::defaultMode()); > > Could we make this a default parameter? Sure, could be done as a separate patch. > > Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.h:65 > > + void didReceiveRedirectResponse(WebCore::ResourceResponse&&); > > Do we want to just inform that a redirect happened, or will we in the future > have a need for the service worker to be able to reject the redirect? When fetch event respondWith is called, there is no way back. A DocumentLoader may trigger another service worker fetch which will be treated as another fetch event. > > Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:201 > > + auto formData = WTFMove(m_formData); > > + didReceiveFormDataAndFinish(formData.releaseNonNull()); > > Could we just call m_formData.releaseNonNull() without WTFMove? > > > Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:86 > > + RefPtr<WebCore::SharedBuffer> m_buffer; > > + RefPtr<FormData> m_formData; > > Can these be a Variant, or could we have more than one of these? > > > Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:88 > > + Optional<ResourceError> m_error; > > Making this a std::unique_ptr would save memory in the common case. I updated the patch to make all of these a Variant with proper Ref<>, UniqueRef<>.
WebKit Commit Bot
Comment 6 2019-02-15 12:25:08 PST
Comment on attachment 362140 [details] Patch for landing Clearing flags on attachment: 362140 Committed r241603: <https://trac.webkit.org/changeset/241603>
WebKit Commit Bot
Comment 7 2019-02-15 12:25:09 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 8 2019-02-15 12:26:56 PST
youenn fablet
Comment 9 2019-02-15 12:42:36 PST
Reopening to attach new patch.
youenn fablet
Comment 10 2019-02-15 12:42:37 PST
WebKit Commit Bot
Comment 11 2019-02-15 13:18:52 PST
Comment on attachment 362146 [details] Patch Clearing flags on attachment: 362146 Committed r241609: <https://trac.webkit.org/changeset/241609>
WebKit Commit Bot
Comment 12 2019-02-15 13:18:54 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.