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

Issue 2527353002: Phase II Step 3: Reload LoFi/placeholder images via new ImageResource

Created:
4 years ago by hiroshige
Modified:
3 years, 9 months ago
CC:
chromium-reviews, tyoshino+watch_chromium.org, blink-reviews-style_chromium.org, blink-reviews-css, Yoav Weiss, loading-reviews_chromium.org, dglazkov+blink, apavlov+blink_chromium.org, gavinp+loader_chromium.org, darktears, blink-reviews, loading-reviews+fetch_chromium.org, Nate Chapin, rwlbuis
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Phase II Step 3: Reload LoFi/placeholder images via new ImageResource Design doc: https://docs.google.com/document/d/1O-fB83mrE0B_V8gzXNqHgmRLCvstTB4MMi3RnVLr8bE/edit#heading=h.1rxkos5samv7 Previously, the same ImageResource is used for reloading a LoFi/placeholder image, which makes Resource state control more complex and prevents more flexible reloading. In this CL, we 1. Creates a new ImageResource for reloading, 2. Detach the ImageResourceContent from the old ImageResource and attach it to the new ImageResource, and 3. Start normal resource loading for the new ImageResource. We can simplify ImageResource state control because we no longer "reload" ImageResources for LoFi/Placeholder images. Particularly, this CL removes: - Logic for suppressing imageNotifyFinished(): -- ImageResource::m_isSchedulingReload -- ImageResourceInfo::isSchedulingReload() -- ImageResourceInfo::schedulingReloadOrShouldReloadBrokenPlaceholder() - Resource state rewinding: setStatus() call in reloadIfLoFiOrPlaceholderImage() - Direct calls to ResourceFetcher::startLoad() and ResourceLoader::cancel() in ImageResource::reloadIfLoFiOrPlaceholderImage() - Modifications to |m_resourceRequest| after the initial request: -- Resource::setCachePolicyBypassingCache() -- Resource::setPreviewsStateNoTransform() -- Resource::clearRangeRequestHeader() Because we use the same ImageResourceContent object, the users of images that references ImageResourceContent can get the reloaded images and ImageResourceObservers are notified of reloaded image updates. Other changes: - Additionally triggers LoFi reloading in ImageResource::decodeError(). - Added null checks of getContent() to allow detaching the content. - Added |FetchRequest::m_enforceNewResource| in order to create a new ImageResource (that should be attached to the existing ImageResourceContent). BUG=667641, 677188

Patch Set 1 #

Patch Set 2 : Remove ResourceFetcher reference from ImaggeResourceContent #

Patch Set 3 : Rebase #

Total comments: 5

Patch Set 4 : tests #

Total comments: 1

Patch Set 5 : Rebase #

Patch Set 6 : Rebase #

Patch Set 7 : Rebase. #

Patch Set 8 : Call requestResource() #

Patch Set 9 : test fix #

Patch Set 10 : reloadLoFiImages test #

Total comments: 17

Patch Set 11 : Rebase #

Patch Set 12 : Rebase. #

Patch Set 13 : Design change: Initiate reloading from ResourceFetcher, clear image immediately on reload. #

Patch Set 14 : Remove resourceForTest() #

Patch Set 15 : style #

Patch Set 16 : Rebase #

Patch Set 17 : Rebase #

Patch Set 18 : Fix1: determine placeholder settings before didFinishLoading(), if possible. #

Patch Set 19 : Fix2: Check before and after. #

Patch Set 20 : Fix 3: if we check before/after, double-check in updateImage() not neede? #

Patch Set 21 : Fix4 #

Patch Set 22 : rebase fix #

Patch Set 23 : Remove m_isPlaceholder #

Patch Set 24 : Rebase #

Patch Set 25 : Rebase #

Patch Set 26 : Rebase #

Patch Set 27 : Rebase #

Patch Set 28 : Rebase #

Patch Set 29 : Rebase #

Patch Set 30 : Rebase #

Patch Set 31 : Remove enforceNewResource() and add PlaceholderImageRequestType instead #

Patch Set 32 : Use startLoad() again to avoid re-applying modifications to ResourceRequest on reload #

Total comments: 8

Patch Set 33 : Reflect comments and rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+212 lines, -151 lines) Patch
M third_party/WebKit/Source/core/loader/resource/ImageResource.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 31 4 chunks +5 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResource.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 15 chunks +83 lines, -66 lines 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3 chunks +2 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResourceInfo.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 31 18 chunks +94 lines, -44 lines 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/Resource.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 2 chunks +8 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/Resource.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 2 chunks +0 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 3 chunks +12 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 chunk +5 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 135 (123 generated)
hiroshige
PTAL. This is the main (and currently the last) CL for refactoring LoFi reloading. https://codereview.chromium.org/2527353002/diff/40001/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp ...
4 years ago (2016-12-05 10:12:40 UTC) #18
hiroshige
On 2016/12/05 10:12:40, hiroshige wrote: > PTAL. > > This is the main (and currently ...
4 years ago (2016-12-07 07:18:20 UTC) #23
hiroshige
Rebasing and fixes are done. PTAL again.
4 years ago (2016-12-16 23:01:48 UTC) #41
hiroshige
+japhet@
4 years ago (2016-12-16 23:02:25 UTC) #43
Nate Chapin
I'm still trying to get a feel for the new ImageResource/ImageResourceContent structure, so I apologize ...
3 years, 11 months ago (2016-12-28 00:14:58 UTC) #46
hiroshige
Thanks for your comments! As for test-related code, I'll try to further refactor ImageResourceTest and ...
3 years, 11 months ago (2016-12-28 01:04:21 UTC) #48
hiroshige
I updated the design doc (Phase II): https://docs.google.com/document/d/1O-fB83mrE0B_V8gzXNqHgmRLCvstTB4MMi3RnVLr8bE/edit#heading=h.1rxkos5samv7 and updated this CL. https://codereview.chromium.org/2527353002/diff/180001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp File third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp ...
3 years, 10 months ago (2017-01-25 02:01:49 UTC) #93
hiroshige
Sorry for delay. I think I handled all review comments. PTAL again. I noticed calling ...
3 years, 9 months ago (2017-03-13 21:27:05 UTC) #125
hiroshige
https://codereview.chromium.org/2527353002/diff/180001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp File third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp (right): https://codereview.chromium.org/2527353002/diff/180001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp#newcode785 third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp:785: if (fetchRequest.enforceNewResource()) On 2017/03/13 21:27:04, hiroshige wrote: > On ...
3 years, 9 months ago (2017-03-13 21:29:16 UTC) #126
kouhei (in TOK)
mostly lg % ResourceFetcher::m_documentResources https://codereview.chromium.org/2527353002/diff/740001/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp File third_party/WebKit/Source/core/loader/resource/ImageResource.cpp (right): https://codereview.chromium.org/2527353002/diff/740001/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp#newcode266 third_party/WebKit/Source/core/loader/resource/ImageResource.cpp:266: if (data()) Is this when ...
3 years, 9 months ago (2017-03-15 10:25:28 UTC) #129
hiroshige
https://codereview.chromium.org/2527353002/diff/740001/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp File third_party/WebKit/Source/core/loader/resource/ImageResource.cpp (right): https://codereview.chromium.org/2527353002/diff/740001/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp#newcode266 third_party/WebKit/Source/core/loader/resource/ImageResource.cpp:266: if (data()) On 2017/03/15 10:25:28, kouhei wrote: > Is ...
3 years, 9 months ago (2017-03-15 19:03:31 UTC) #130
yhirano
3 years, 9 months ago (2017-03-17 13:09:35 UTC) #131
https://codereview.chromium.org/2527353002/diff/740001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/loader/resource/ImageResource.cpp (right):

https://codereview.chromium.org/2527353002/diff/740001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/loader/resource/ImageResource.cpp:248: // If
possible, delay the resetting until back at the event loop. Doing so
This comment should be inside of the outer if statement.

https://codereview.chromium.org/2527353002/diff/740001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/loader/resource/ImageResource.cpp:483: if
(!fetcher)
Is passing nullptr valid?

https://codereview.chromium.org/2527353002/diff/740001/third_party/WebKit/Sou...
File third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
(right):

https://codereview.chromium.org/2527353002/diff/740001/third_party/WebKit/Sou...
third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp:1339: for
(auto& documentResource : m_documentResources) {
What is the intention of this change?

Powered by Google App Engine
This is Rietveld 408576698