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

Issue 2650113002: Phase II Step 2: Remove setIsPlaceholder() in updateImage() (Closed)

Created:
3 years, 11 months ago by hiroshige
Modified:
3 years, 9 months ago
CC:
chromium-reviews, blink-reviews, loading-reviews_chromium.org, tyoshino+watch_chromium.org, Nate Chapin, gavinp+loader_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Phase II Step 2: Remove setIsPlaceholder() in updateImage() Design doc: https://docs.google.com/document/d/1O-fB83mrE0B_V8gzXNqHgmRLCvstTB4MMi3RnVLr8bE/edit#heading=h.1rxkos5samv7 Previsouly, |m_isPlaceholder| is cleared in updateImage(), if: - isEntireResource() is true, AND - (1) The HTTP status code is not 4XX or 5XX OR (2) the response has no DecodeError, to prevent creating of placeholder and reloading. However, this causes timing and code dependencies from ImageResourceContent::updateImage() to |ImageResource::m_isPlaceholder| and ImageResource::reloadIfLoFiOrPlaceholderImage(). This CL removes the dependencies and thus ImageResourceInfo::setIsPlaceholder(), by making |ImageResource::m_isPlaceholder| a tri-state enum (renamed as |ImageResource::placeholderOption|): - DoNotReloadPlaceholder (previously m_isPlaceholder == false) - ReloadPlaceholderOnDecodeError (new state) - ShowAndReloadPlaceholderAlways (previously m_isPlaceholder == true) and setting it when receiving ResourceResponse. This CL preserves the behavior of a placeholder ImageResource: If isEntireResource() && (1): Behavior: Placeholder is not created && !shouldReloadBrokenPlaceholder(). Previously: because |m_isPlaceholder| is cleared in updateImage(). Now: because |m_placeholderOption| is set to |DoNotReloadPlaceholder|. If isEntireResource() && not (1) && (2): Behavior: Placeholder is not created && !shouldReloadBrokenPlaceholder(). Previously: because |m_isPlaceholder| is cleared in updateImage(). Now: because |m_placeholderOption| is set to |ReloadPlaceholderOnDecodeError| and DecodeError does NOT occur because (2) is true. If isEntireResource() && not (1) && not (2): Behavior: Placeholder is not created && shouldReloadBrokenPlaceholder(). Previously: because updateImage() creates placeholder only if (2) is true and |m_isPlaceholder| is NOT cleared in updateImage(). Now: because |m_placeholderOption| is set to |ReloadPlaceholderOnDecodeError| and DecodeError does occur because (2) is false. Otherwise: Not affected. BUG=667641, 677188 Review-Url: https://codereview.chromium.org/2650113002 Cr-Commit-Position: refs/heads/master@{#455282} Committed: https://chromium.googlesource.com/chromium/src/+/810f7ecd76b0aba74f0a215dbd00b8e8cc5705ba

Patch Set 1 #

Patch Set 2 : fix #

Patch Set 3 : Rebase #

Patch Set 4 : Rebase #

Patch Set 5 : Rebase #

Patch Set 6 : Rebase #

Patch Set 7 : Rebase #

Patch Set 8 : compile fix #

Total comments: 4

Patch Set 9 : Rebase #

Patch Set 10 : Reflect yhirano comments #

Patch Set 11 : Rebase #

Patch Set 12 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+104 lines, -81 lines) Patch
M third_party/WebKit/Source/core/loader/resource/ImageResource.h View 1 2 3 4 5 6 7 8 9 3 chunks +13 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 chunks +70 lines, -14 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 4 chunks +3 lines, -38 lines 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResourceInfo.h View 1 2 3 2 chunks +1 line, -4 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 17 chunks +17 lines, -17 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 51 (42 generated)
hiroshige
PTAL.
3 years, 10 months ago (2017-02-11 00:01:18 UTC) #19
yhirano
https://codereview.chromium.org/2650113002/diff/140001/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp File third_party/WebKit/Source/core/loader/resource/ImageResource.cpp (right): https://codereview.chromium.org/2650113002/diff/140001/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp#newcode428 third_party/WebKit/Source/core/loader/resource/ImageResource.cpp:428: m_placeholderOption = ReloadPlaceholderOnDecodeError; Is DoNotReloadPlaceholder => ReloadPlaceholderOnDecodeError transition valid? ...
3 years, 10 months ago (2017-02-13 11:36:57 UTC) #28
hiroshige
https://codereview.chromium.org/2650113002/diff/140001/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp File third_party/WebKit/Source/core/loader/resource/ImageResource.cpp (right): https://codereview.chromium.org/2650113002/diff/140001/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp#newcode428 third_party/WebKit/Source/core/loader/resource/ImageResource.cpp:428: m_placeholderOption = ReloadPlaceholderOnDecodeError; On 2017/02/13 11:36:57, yhirano wrote: > ...
3 years, 10 months ago (2017-02-23 20:52:38 UTC) #30
yhirano
lgtm
3 years, 10 months ago (2017-02-24 17:17:27 UTC) #34
hiroshige
Thanks! sclittle@, could you also take a look?
3 years, 10 months ago (2017-02-24 18:31:44 UTC) #35
hiroshige
On 2017/02/24 18:31:44, hiroshige wrote: > Thanks! > > sclittle@, could you also take a ...
3 years, 9 months ago (2017-03-01 18:42:46 UTC) #36
sclittle
LGTM! Sorry for the delayed review.
3 years, 9 months ago (2017-03-07 21:16:12 UTC) #45
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/2650113002/220001
3 years, 9 months ago (2017-03-07 21:20:38 UTC) #48
commit-bot: I haz the power
3 years, 9 months ago (2017-03-07 23:24:22 UTC) #51
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://chromium.googlesource.com/chromium/src/+/810f7ecd76b0aba74f0a215dbd00...

Powered by Google App Engine
This is Rietveld 408576698