Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Issue 2516353002: Introduce url_list to the Response scheme of CacheStorage. (Closed)

Created:
4 years, 1 month ago by horo
Modified:
4 years ago
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-worker-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, falken+watch_chromium.org, gavinp+loader_chromium.org, haraken, horo+watch_chromium.org, jam, Nate Chapin, jkarlin+watch_chromium.org, jsbell+serviceworker_chromium.org, jsbell, kinuko+watch, kinuko+serviceworker, loading-reviews_chromium.org, michaeln, mlamouri+watch-content_chromium.org, serviceworker-reviews, shimazu+serviceworker_chromium.org, tyoshino+watch_chromium.org, tzik
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce url_list to the Response scheme of CacheStorage. According to the spec, the CacheStorage has to store the URL list of responses. https://github.com/w3c/ServiceWorker/issues/737#issuecomment-175844226 So this cl introduces url_list to the Response scheme of CacheStorage, and pass it from FetchManager::Loader to CacheStorage and ServiceWorkerURLRequestJob and ResourceResponse. To let FetchManager::Loader know the URL list, this cl introduces ThreadableLoaderClient::didReceiveRedirectTo(). DocumentThreadableLoader calls didReceiveRedirectTo() when it received a redirect response. - If fetch() in called on the main thread, FetchManager::Loader's didReceiveRedirectTo() is called directly from DocumentThreadableLoader. - If fetch() is called on the worker thread, FetchManager::Loader's didReceiveRedirectTo() is called via WorkerThreadableLoader:: MainThreadLoaderHolder. And FetchManager::Loader::didReceiveResponse() sets the URL list to FetchResponseData. When FetchEvent.respondWith(response) is called in the SW, the URL list is passed to ServiceWorkerURLRequestJob via blink::WebServiceWorkerResponse and content::ServiceWorkerResponse. And when the browser process sends the response to the controlled page, the URL list is passed via content::ResourceResponseInfo and blink::WebURLResponse and blink::ResourceResponse. If Cache.put(request, response) is called, the URL list is passed to CacheStorageCache::Put() via blink::WebServiceWorkerResponse and content::ServiceWorkerResponse. And it converts the list to the protobuf and save to the storage. When Cache.match(request) returns the response to the renderer process, the URL list is read from the protobuf in the storage and passed via content::ServiceWorkerResponse and blink::WebServiceWorkerResponse to the renderer process. BUG=658249 Committed: https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6 Cr-Commit-Position: refs/heads/master@{#437241}

Patch Set 1 #

Total comments: 30

Patch Set 2 : incorporated falken's comment #

Total comments: 16

Patch Set 3 : incorporated falken's comment #

Total comments: 10

Patch Set 4 : incorporated falken's comment #

Total comments: 6

Patch Set 5 : incorpodated cmumford@'s comment #

Total comments: 8

Patch Set 6 : use Vector in createTestWebServiceWorkerResponse() #

Patch Set 7 : implicit conversion WebURL <-> GURL and WebVector <- vector #

Unified diffs Side-by-side diffs Delta from patch set Stats (+439 lines, -271 lines) Patch
M content/browser/cache_storage/cache_storage.proto View 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/cache_storage/cache_storage_cache.cc View 1 2 3 chunks +27 lines, -20 lines 0 comments Download
M content/browser/cache_storage/cache_storage_cache_unittest.cc View 1 2 3 6 chunks +59 lines, -38 lines 0 comments Download
M content/browser/cache_storage/cache_storage_manager_unittest.cc View 1 2 1 chunk +8 lines, -3 lines 0 comments Download
M content/browser/service_worker/embedded_worker_test_helper.cc View 1 chunk +5 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_response_info.h View 1 2 4 chunks +14 lines, -9 lines 0 comments Download
M content/browser/service_worker/service_worker_response_info.cc View 4 chunks +4 lines, -5 lines 0 comments Download
M content/browser/service_worker/service_worker_url_request_job.h View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_url_request_job.cc View 1 2 3 4 3 chunks +9 lines, -8 lines 0 comments Download
M content/browser/service_worker/service_worker_url_request_job_unittest.cc View 1 2 3 4 17 chunks +41 lines, -31 lines 0 comments Download
M content/child/web_url_loader_impl.cc View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M content/common/resource_messages.h View 1 chunk +1 line, -1 line 0 comments Download
M content/common/service_worker/service_worker_messages.h View 1 chunk +1 line, -1 line 0 comments Download
M content/common/service_worker/service_worker_types.h View 3 chunks +5 lines, -4 lines 0 comments Download
M content/common/service_worker/service_worker_types.cc View 3 chunks +11 lines, -9 lines 0 comments Download
M content/public/common/resource_response.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/public/common/resource_response_info.h View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M content/renderer/cache_storage/cache_storage_dispatcher.cc View 1 2 3 4 5 6 3 chunks +6 lines, -21 lines 0 comments Download
M content/renderer/service_worker/service_worker_context_client.cc View 1 2 3 2 chunks +3 lines, -15 lines 0 comments Download
M content/renderer/service_worker/service_worker_type_util.h View 1 1 chunk +2 lines, -7 lines 0 comments Download
M content/renderer/service_worker/service_worker_type_util.cc View 1 2 3 chunks +38 lines, -16 lines 0 comments Download
M media/blink/multibuffer_data_source_unittest.cc View 1 2 3 5 chunks +10 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/ThreadableLoaderClient.h View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h View 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/WorkerThreadableLoader.cpp View 3 chunks +21 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp View 1 2 3 4 4 chunks +15 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchManager.cpp View 1 2 3 4 5 6 chunks +20 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchResponseData.h View 4 chunks +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp View 6 chunks +17 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchResponseDataTest.cpp View 1 2 3 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/Response.cpp View 1 2 3 4 5 2 chunks +11 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/ResponseTest.cpp View 1 2 3 4 5 9 chunks +24 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/FetchEvent.cpp View 1 2 1 chunk +6 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/exported/WebServiceWorkerResponse.cpp View 2 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/exported/WebURLResponse.cpp View 1 2 chunks +12 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/platform/network/ResourceResponse.h View 1 2 3 3 chunks +13 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/platform/network/ResourceResponse.cpp View 3 chunks +12 lines, -2 lines 0 comments Download
M third_party/WebKit/public/platform/WebURLResponse.h View 1 2 2 chunks +11 lines, -6 lines 0 comments Download
M third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerResponse.h View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 101 (75 generated)
horo
falken@ Could you please review this?
4 years ago (2016-11-29 07:55:38 UTC) #41
falken
Overall question: Why does cache storage need the whole |url_list| instead of just |redirected|? Is ...
4 years ago (2016-11-30 14:57:38 UTC) #45
horo
> Overall question: Why does cache storage need the whole |url_list| instead of > just ...
4 years ago (2016-12-01 07:42:14 UTC) #46
falken
Round of comments. Regarding storing the url_list, it looks like Mozilla had a similar question ...
4 years ago (2016-12-05 01:22:34 UTC) #51
horo
https://codereview.chromium.org/2516353002/diff/160001/content/browser/cache_storage/cache_storage_cache.cc File content/browser/cache_storage/cache_storage_cache.cc (right): https://codereview.chromium.org/2516353002/diff/160001/content/browser/cache_storage/cache_storage_cache.cc#newcode958 content/browser/cache_storage/cache_storage_cache.cc:958: new ServiceWorkerResponse(operation.response)); On 2016/12/05 01:22:33, falken wrote: > nit: ...
4 years ago (2016-12-05 03:39:49 UTC) #54
falken
lgtm, sorry for delays. https://codereview.chromium.org/2516353002/diff/180001/content/browser/cache_storage/cache_storage_cache_unittest.cc File content/browser/cache_storage/cache_storage_cache_unittest.cc (right): https://codereview.chromium.org/2516353002/diff/180001/content/browser/cache_storage/cache_storage_cache_unittest.cc#newcode411 content/browser/cache_storage/cache_storage_cache_unittest.cc:411: base::MakeUnique<std::vector<GURL>>()); = base::MakeUnique (and all ...
4 years ago (2016-12-05 04:32:42 UTC) #55
horo
Thank you. https://codereview.chromium.org/2516353002/diff/180001/content/browser/cache_storage/cache_storage_cache_unittest.cc File content/browser/cache_storage/cache_storage_cache_unittest.cc (right): https://codereview.chromium.org/2516353002/diff/180001/content/browser/cache_storage/cache_storage_cache_unittest.cc#newcode411 content/browser/cache_storage/cache_storage_cache_unittest.cc:411: base::MakeUnique<std::vector<GURL>>()); On 2016/12/05 04:32:42, falken wrote: > ...
4 years ago (2016-12-05 04:58:32 UTC) #61
horo
nhiroki@ Could you please review content/browser/cache_storage/* and content/renderer/cache_storage/*?
4 years ago (2016-12-05 05:00:46 UTC) #63
nhiroki
+jsbell@ because this changes a serialization format of the cache storage and probably storage folks ...
4 years ago (2016-12-05 07:25:13 UTC) #67
jsbell
cmumford@ - can you take a look? This may conflict with the work you and ...
4 years ago (2016-12-05 17:21:16 UTC) #69
cmumford
What about adding a new tests with multiple URL's. I think all tests still have ...
4 years ago (2016-12-05 19:24:19 UTC) #70
horo
I created a cl which add LayoutTests for URL list. https://codereview.chromium.org/2550363002#ps1 Do you think I ...
4 years ago (2016-12-06 05:47:36 UTC) #71
cmumford
lgtm
4 years ago (2016-12-06 17:31:46 UTC) #72
horo
mkwst@ Could you please review third_party/WebKit/*?
4 years ago (2016-12-07 01:07:46 UTC) #74
horo
hubbe@ Could you please review media/blink/multibuffer_data_source_unittest.cc?
4 years ago (2016-12-07 01:11:30 UTC) #76
hubbe
On 2016/12/07 01:11:30, horo wrote: > hubbe@ > Could you please review media/blink/multibuffer_data_source_unittest.cc? media/blink/multibuffer_data_source_unittest.cc LGTM
4 years ago (2016-12-07 01:13:36 UTC) #77
horo
kinuko@ Could you please review content/child/web_url_loader_impl.cc content/public/common/resource_response.cc content/public/common/resource_response_info.h?
4 years ago (2016-12-07 01:13:45 UTC) #79
nhiroki
https://codereview.chromium.org/2516353002/diff/240001/third_party/WebKit/Source/modules/fetch/ResponseTest.cpp File third_party/WebKit/Source/modules/fetch/ResponseTest.cpp (right): https://codereview.chromium.org/2516353002/diff/240001/third_party/WebKit/Source/modules/fetch/ResponseTest.cpp#newcode40 third_party/WebKit/Source/modules/fetch/ResponseTest.cpp:40: std::vector<WebURL> urlList; WTF::Vector https://codereview.chromium.org/2516353002/diff/240001/third_party/WebKit/Source/modules/fetch/ResponseTest.cpp#newcode60 third_party/WebKit/Source/modules/fetch/ResponseTest.cpp:60: Vector<KURL> urlList; Can you ...
4 years ago (2016-12-07 02:05:57 UTC) #80
horo
https://codereview.chromium.org/2516353002/diff/240001/third_party/WebKit/Source/modules/fetch/ResponseTest.cpp File third_party/WebKit/Source/modules/fetch/ResponseTest.cpp (right): https://codereview.chromium.org/2516353002/diff/240001/third_party/WebKit/Source/modules/fetch/ResponseTest.cpp#newcode40 third_party/WebKit/Source/modules/fetch/ResponseTest.cpp:40: std::vector<WebURL> urlList; On 2016/12/07 02:05:57, nhiroki wrote: > WTF::Vector ...
4 years ago (2016-12-07 03:37:48 UTC) #83
kinuko
lgtm % nits https://codereview.chromium.org/2516353002/diff/240001/content/child/web_url_loader_impl.cc File content/child/web_url_loader_impl.cc (right): https://codereview.chromium.org/2516353002/diff/240001/content/child/web_url_loader_impl.cc#newcode1060 content/child/web_url_loader_impl.cc:1060: response->setURLListViaServiceWorker(url_list_via_service_worker); I think this can likely ...
4 years ago (2016-12-07 04:08:42 UTC) #84
nhiroki
lgtm https://codereview.chromium.org/2516353002/diff/240001/third_party/WebKit/Source/modules/fetch/ResponseTest.cpp File third_party/WebKit/Source/modules/fetch/ResponseTest.cpp (right): https://codereview.chromium.org/2516353002/diff/240001/third_party/WebKit/Source/modules/fetch/ResponseTest.cpp#newcode60 third_party/WebKit/Source/modules/fetch/ResponseTest.cpp:60: Vector<KURL> urlList; On 2016/12/07 03:37:48, horo wrote: > ...
4 years ago (2016-12-07 04:16:07 UTC) #85
horo
Thank you. https://codereview.chromium.org/2516353002/diff/240001/content/child/web_url_loader_impl.cc File content/child/web_url_loader_impl.cc (right): https://codereview.chromium.org/2516353002/diff/240001/content/child/web_url_loader_impl.cc#newcode1060 content/child/web_url_loader_impl.cc:1060: response->setURLListViaServiceWorker(url_list_via_service_worker); On 2016/12/07 04:08:42, kinuko wrote: > ...
4 years ago (2016-12-07 05:31:44 UTC) #90
Mike West
LGTM (sorry for the delayed response).
4 years ago (2016-12-08 09:12:41 UTC) #93
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2516353002/280001
4 years ago (2016-12-08 12:33:31 UTC) #96
commit-bot: I haz the power
Committed patchset #7 (id:280001)
4 years ago (2016-12-08 14:34:37 UTC) #99
commit-bot: I haz the power
4 years ago (2016-12-08 14:37:06 UTC) #101
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6
Cr-Commit-Position: refs/heads/master@{#437241}

Powered by Google App Engine
This is Rietveld 408576698