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

Issue 2454983002: Cache-aware Resource loading (Closed)

Created:
4 years, 1 month ago by Shao-Chuan Lee
Modified:
4 years, 1 month ago
Reviewers:
hiroshige, kinuko, yhirano
CC:
chromium-reviews, tyoshino+watch_chromium.org, Yoav Weiss, gavinp+loader_chromium.org, blink-reviews, loading-reviews+fetch_chromium.org, Nate Chapin
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Cache-aware Resource loading If cache-aware loading is enabled, the Resource is notified of disk cache miss from network stack during loading. This is implemented by sending a request to load only from disk cache, and retry with original request if the first one fails. Resource is notified of the cache miss through callback willReloadAfterDiskCacheMiss() before the retry. Now we provide an option in ResourceLoaderOptions to enable cache-aware loading through FetchRequest. However there are cases that cache-aware loading is not actually activated: - The request specifies loading synchronously - The request is for Resource revalidation - Cache policy is already explicitly set The user may determine whether cache-aware loading is actually activated with ResourceLoader::isCacheAwareLoadingActivated(). Redirect responses from disk cache are not supported, we will fail the request as cache miss and retry. This feature will be used in webfonts cache-aware timeout adaptation, which changes webfont display behavior according to whether the webfont is already on disk cache or will be loaded from network. See https://codereview.chromium.org/2390583002/ for details. BUG=570205 Committed: https://crrev.com/27405ff42bf94769bb5310a217957551364ee061 Cr-Commit-Position: refs/heads/master@{#430891}

Patch Set 1 #

Total comments: 2

Patch Set 2 : fix #3, add DCHECK, add missing header #

Total comments: 5

Patch Set 3 : move deactivation from fetcher to loader #

Patch Set 4 : rebase, use new flag #

Patch Set 5 : rebase #

Patch Set 6 : don't call willReloadAfterDiskCacheMiss() if not activated #

Patch Set 7 : move options check into loader, rename & comments #

Total comments: 1

Patch Set 8 : rebase #

Patch Set 9 : check synchronous policy #

Total comments: 4

Patch Set 10 : comment on Resource callback #

Total comments: 2

Patch Set 11 : copy ResourceRequest only on CAL activation #

Total comments: 3

Patch Set 12 : nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+103 lines, -6 lines) Patch
M third_party/WebKit/Source/core/fetch/FetchRequest.h View 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/Resource.h View 1 2 3 4 5 6 7 8 9 1 chunk +13 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp View 1 2 3 4 5 6 7 2 chunks +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceLoader.h View 1 2 3 4 5 6 3 chunks +12 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +53 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceLoaderOptions.h View 7 chunks +14 lines, -3 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 57 (32 generated)
Shao-Chuan Lee
PTAL Still waiting for https://codereview.chromium.org/2398613002/, will have a separate CL for adding new WebCachePolicy.
4 years, 1 month ago (2016-10-27 07:16:11 UTC) #2
yhirano
https://codereview.chromium.org/2454983002/diff/1/third_party/WebKit/Source/core/fetch/ResourceLoader.h File third_party/WebKit/Source/core/fetch/ResourceLoader.h (right): https://codereview.chromium.org/2454983002/diff/1/third_party/WebKit/Source/core/fetch/ResourceLoader.h#newcode70 third_party/WebKit/Source/core/fetch/ResourceLoader.h:70: bool willActivateCacheAwareLoading(const ResourceRequest&); activateCacheAwareLoading might be a better name. ...
4 years, 1 month ago (2016-10-27 07:33:01 UTC) #3
Shao-Chuan Lee
https://codereview.chromium.org/2454983002/diff/1/third_party/WebKit/Source/core/fetch/ResourceLoader.h File third_party/WebKit/Source/core/fetch/ResourceLoader.h (right): https://codereview.chromium.org/2454983002/diff/1/third_party/WebKit/Source/core/fetch/ResourceLoader.h#newcode70 third_party/WebKit/Source/core/fetch/ResourceLoader.h:70: bool willActivateCacheAwareLoading(const ResourceRequest&); On 2016/10/27 07:33:00, yhirano wrote: > ...
4 years, 1 month ago (2016-10-27 07:42:55 UTC) #4
yhirano
lgtm
4 years, 1 month ago (2016-10-27 07:46:08 UTC) #5
hiroshige
https://codereview.chromium.org/2454983002/diff/20001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp File third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp (right): https://codereview.chromium.org/2454983002/diff/20001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp#newcode1184 third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp:1184: } Can we move this block to ResourceLoader::didFail() and ...
4 years, 1 month ago (2016-10-27 08:21:48 UTC) #6
Shao-Chuan Lee
https://codereview.chromium.org/2454983002/diff/20001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp File third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp (right): https://codereview.chromium.org/2454983002/diff/20001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp#newcode1184 third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp:1184: } On 2016/10/27 08:21:48, hiroshige wrote: > Can we ...
4 years, 1 month ago (2016-10-28 04:14:14 UTC) #7
hiroshige
lgtm. (Also adding unit tests is preferable, but it will require e.g. modest modification to ...
4 years, 1 month ago (2016-10-31 08:25:19 UTC) #8
Shao-Chuan Lee
On 2016/10/31 08:25:19, hiroshige wrote: > lgtm. > > (Also adding unit tests is preferable, ...
4 years, 1 month ago (2016-10-31 08:52:44 UTC) #9
Shao-Chuan Lee
Minor design change: now the cache miss callback is not called if CAL cannot be ...
4 years, 1 month ago (2016-11-01 07:53:51 UTC) #17
Shao-Chuan Lee
- Move ResourceLoaderOptions check into ResourceLoader - Rename activateCacheAwareLoading{,IfNeeded} https://codereview.chromium.org/2454983002/diff/120001/third_party/WebKit/Source/core/fetch/ResourceLoader.h File third_party/WebKit/Source/core/fetch/ResourceLoader.h (right): https://codereview.chromium.org/2454983002/diff/120001/third_party/WebKit/Source/core/fetch/ResourceLoader.h#newcode73 third_party/WebKit/Source/core/fetch/ResourceLoader.h:73: ...
4 years, 1 month ago (2016-11-02 03:41:11 UTC) #20
Shao-Chuan Lee
Ping if you have further comments since PS5. This CL is ready for submission.
4 years, 1 month ago (2016-11-08 05:10:10 UTC) #33
kinuko
drive-by nit comment https://codereview.chromium.org/2454983002/diff/160001/third_party/WebKit/Source/core/fetch/Resource.h File third_party/WebKit/Source/core/fetch/Resource.h (right): https://codereview.chromium.org/2454983002/diff/160001/third_party/WebKit/Source/core/fetch/Resource.h#newcode315 third_party/WebKit/Source/core/fetch/Resource.h:315: virtual void willReloadAfterDiskCacheMiss() {} nit/optional: This ...
4 years, 1 month ago (2016-11-08 06:10:18 UTC) #36
Shao-Chuan Lee
https://codereview.chromium.org/2454983002/diff/160001/third_party/WebKit/Source/core/fetch/Resource.h File third_party/WebKit/Source/core/fetch/Resource.h (right): https://codereview.chromium.org/2454983002/diff/160001/third_party/WebKit/Source/core/fetch/Resource.h#newcode315 third_party/WebKit/Source/core/fetch/Resource.h:315: virtual void willReloadAfterDiskCacheMiss() {} On 2016/11/08 06:10:18, kinuko wrote: ...
4 years, 1 month ago (2016-11-08 06:28:01 UTC) #37
kinuko
https://codereview.chromium.org/2454983002/diff/160001/third_party/WebKit/Source/core/fetch/Resource.h File third_party/WebKit/Source/core/fetch/Resource.h (right): https://codereview.chromium.org/2454983002/diff/160001/third_party/WebKit/Source/core/fetch/Resource.h#newcode315 third_party/WebKit/Source/core/fetch/Resource.h:315: virtual void willReloadAfterDiskCacheMiss() {} On 2016/11/08 06:28:01, Shao-Chuan Lee ...
4 years, 1 month ago (2016-11-08 06:42:15 UTC) #39
Shao-Chuan Lee
https://codereview.chromium.org/2454983002/diff/160001/third_party/WebKit/Source/core/fetch/Resource.h File third_party/WebKit/Source/core/fetch/Resource.h (right): https://codereview.chromium.org/2454983002/diff/160001/third_party/WebKit/Source/core/fetch/Resource.h#newcode315 third_party/WebKit/Source/core/fetch/Resource.h:315: virtual void willReloadAfterDiskCacheMiss() {} On 2016/11/08 06:42:15, kinuko wrote: ...
4 years, 1 month ago (2016-11-08 07:19:06 UTC) #42
yhirano
still lgtm
4 years, 1 month ago (2016-11-08 07:32:01 UTC) #43
kinuko
looking good, I have one more question (though no need to be blocked by my ...
4 years, 1 month ago (2016-11-08 12:21:55 UTC) #44
Shao-Chuan Lee
Comments are welcomed! Thanks for looking into this. https://codereview.chromium.org/2454983002/diff/180001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp File third_party/WebKit/Source/core/fetch/ResourceLoader.cpp (right): https://codereview.chromium.org/2454983002/diff/180001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp#newcode87 third_party/WebKit/Source/core/fetch/ResourceLoader.cpp:87: ResourceRequest ...
4 years, 1 month ago (2016-11-09 03:48:01 UTC) #45
kinuko
On 2016/11/09 03:48:01, Shao-Chuan Lee wrote: > Comments are welcomed! Thanks for looking into this. ...
4 years, 1 month ago (2016-11-09 04:32:04 UTC) #46
kinuko
two more nits (and lgtm) https://codereview.chromium.org/2454983002/diff/200001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp File third_party/WebKit/Source/core/fetch/ResourceLoader.cpp (right): https://codereview.chromium.org/2454983002/diff/200001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp#newcode90 third_party/WebKit/Source/core/fetch/ResourceLoader.cpp:90: if (m_resource->options().synchronousPolicy == RequestSynchronously) ...
4 years, 1 month ago (2016-11-09 04:34:24 UTC) #47
hiroshige
Patch Set 11 still lgtm.
4 years, 1 month ago (2016-11-09 05:27:47 UTC) #48
Shao-Chuan Lee
https://codereview.chromium.org/2454983002/diff/200001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp File third_party/WebKit/Source/core/fetch/ResourceLoader.cpp (right): https://codereview.chromium.org/2454983002/diff/200001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp#newcode90 third_party/WebKit/Source/core/fetch/ResourceLoader.cpp:90: if (m_resource->options().synchronousPolicy == RequestSynchronously) { On 2016/11/09 04:34:24, kinuko ...
4 years, 1 month ago (2016-11-09 06:54:32 UTC) #49
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/2454983002/220001
4 years, 1 month ago (2016-11-09 06:55:40 UTC) #52
commit-bot: I haz the power
Committed patchset #12 (id:220001)
4 years, 1 month ago (2016-11-09 08:25:18 UTC) #55
commit-bot: I haz the power
4 years, 1 month ago (2016-11-09 08:28:22 UTC) #57
Message was sent while issue was closed.
Patchset 12 (id:??) landed as
https://crrev.com/27405ff42bf94769bb5310a217957551364ee061
Cr-Commit-Position: refs/heads/master@{#430891}

Powered by Google App Engine
This is Rietveld 408576698