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

Issue 2423683002: Add Blink support for showing image placeholders using range requests. (Closed)

Created:
4 years, 2 months ago by sclittle
Modified:
4 years, 1 month ago
CC:
chromium-reviews, blink-reviews-platform-graphics_chromium.org, dshwang, apavlov+blink_chromium.org, rwlbuis, Yoav Weiss, krit, drott+blinkwatch_chromium.org, blink-reviews-css, Justin Novosad, dglazkov+blink, Rik, gavinp+loader_chromium.org, loading-reviews_chromium.org, ajuma+watch_chromium.org, jbroman, blink-reviews, pdr+graphicswatchlist_chromium.org, darktears, loading-reviews+fetch_chromium.org, Nate Chapin, Stephen Chennney, tyoshino+watch_chromium.org, f(malita), danakj+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add Blink support for showing image placeholders using range requests. Design doc: https://docs.google.com/document/d/1691W7yFDI1FJv69N2MEtaSzpnqO2EqkgGD3T0O-pQ08/edit?usp=sharing This CL introduces support for issuing a range request for just the first few bytes of an image, and showing a translucent gray box of the same size as the image in the image's place if the original image's dimensions can be decoded from the returned range. Currently, this behavior is only activated via a blink-settings flag. In the future, features such as Data Saver will activate this functionality to save data for users. BUG=605350, 605351 Committed: https://crrev.com/72b7454b7d1ea60317365a076187da54e646e88e Cr-Commit-Position: refs/heads/master@{#427141}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Addressed comments and fixed bugs #

Total comments: 16

Patch Set 3 : Addressed comments #

Total comments: 8

Patch Set 4 : Addressed comments #

Patch Set 5 : Rebased on master #

Patch Set 6 : Change test data to "const unsigned char" instead of "const char" to fix warnings in windows build #

Unified diffs Side-by-side diffs Delta from patch set Stats (+841 lines, -186 lines) Patch
M third_party/WebKit/Source/core/css/CSSImageSetValue.cpp View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSImageValue.cpp View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/FetchRequest.h View 1 2 3 chunks +15 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/FetchRequest.cpp View 1 2 3 5 chunks +30 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ImageResource.h View 1 2 5 chunks +27 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ImageResource.cpp View 1 2 3 10 chunks +78 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp View 1 2 3 4 5 21 chunks +487 lines, -152 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/Resource.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/Resource.cpp View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp View 1 2 3 chunks +11 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/Settings.in View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentLoader.cpp View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/ImageLoader.cpp View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/ProgressTracker.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/page/DragController.cpp View 1 2 3 3 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/BUILD.gn View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/graphics/PlaceholderImage.h View 1 1 chunk +76 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/graphics/PlaceholderImage.cpp View 1 1 chunk +89 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (10 generated)
sclittle
4 years, 2 months ago (2016-10-15 02:23:33 UTC) #2
Stephen Chennney
fmalita@ should also take a look. I'm not sure who is good to review resource ...
4 years, 2 months ago (2016-10-17 18:09:17 UTC) #4
sclittle
https://codereview.chromium.org/2423683002/diff/1/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/2423683002/diff/1/third_party/WebKit/Source/core/fetch/ImageResource.cpp#newcode604 third_party/WebKit/Source/core/fetch/ImageResource.cpp:604: setLoFiStateOff(); On 2016/10/17 18:09:17, Stephen Chennney wrote: > It ...
4 years, 2 months ago (2016-10-18 00:54:11 UTC) #5
Stephen Chennney
It looks good to me but I would still like a second pair of eyes. ...
4 years, 2 months ago (2016-10-18 17:36:57 UTC) #6
Nate Chapin
https://chromiumcodereview.appspot.com/2423683002/diff/20001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): https://chromiumcodereview.appspot.com/2423683002/diff/20001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#newcode67 third_party/WebKit/Source/core/fetch/ImageResource.cpp:67: const FetchRequest* m_fetchRequest; Instead of stashing the FetchRequest here ...
4 years, 2 months ago (2016-10-18 18:23:17 UTC) #7
sclittle
https://chromiumcodereview.appspot.com/2423683002/diff/20001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): https://chromiumcodereview.appspot.com/2423683002/diff/20001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#newcode67 third_party/WebKit/Source/core/fetch/ImageResource.cpp:67: const FetchRequest* m_fetchRequest; On 2016/10/18 18:23:17, Nate Chapin wrote: ...
4 years, 2 months ago (2016-10-18 23:53:04 UTC) #8
Nate Chapin
https://codereview.chromium.org/2423683002/diff/40001/third_party/WebKit/Source/core/fetch/FetchRequest.cpp File third_party/WebKit/Source/core/fetch/FetchRequest.cpp (right): https://codereview.chromium.org/2423683002/diff/40001/third_party/WebKit/Source/core/fetch/FetchRequest.cpp#newcode132 third_party/WebKit/Source/core/fetch/FetchRequest.cpp:132: m_placeholderImageRequestType = DisallowPlaceholder; Is this needed? Can we DCHECK(m_placeholderImageRequestType ...
4 years, 2 months ago (2016-10-21 18:23:55 UTC) #9
sclittle
https://codereview.chromium.org/2423683002/diff/40001/third_party/WebKit/Source/core/fetch/FetchRequest.cpp File third_party/WebKit/Source/core/fetch/FetchRequest.cpp (right): https://codereview.chromium.org/2423683002/diff/40001/third_party/WebKit/Source/core/fetch/FetchRequest.cpp#newcode132 third_party/WebKit/Source/core/fetch/FetchRequest.cpp:132: m_placeholderImageRequestType = DisallowPlaceholder; On 2016/10/21 18:23:55, Nate Chapin wrote: ...
4 years, 2 months ago (2016-10-21 18:57:25 UTC) #10
Nate Chapin
lgtm https://codereview.chromium.org/2423683002/diff/40001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/2423683002/diff/40001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#newcode57 third_party/WebKit/Source/core/fetch/ImageResource.cpp:57: Resource* create(const ResourceRequest& request, On 2016/10/21 18:57:25, sclittle ...
4 years, 2 months ago (2016-10-21 19:13:10 UTC) #11
f(malita)
platform/graphics LGTM
4 years, 2 months ago (2016-10-21 19:27:06 UTC) #12
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/2423683002/60001
4 years, 2 months ago (2016-10-21 19:37:32 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/291598) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 2 months ago (2016-10-21 19:40:57 UTC) #16
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/2423683002/80001
4 years, 2 months ago (2016-10-21 19:45:11 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/317099)
4 years, 2 months ago (2016-10-21 20:58:31 UTC) #21
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/2423683002/100001
4 years, 1 month ago (2016-10-24 18:47:20 UTC) #24
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 1 month ago (2016-10-24 20:49:33 UTC) #25
commit-bot: I haz the power
4 years, 1 month ago (2016-10-24 20:51:45 UTC) #27
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/72b7454b7d1ea60317365a076187da54e646e88e
Cr-Commit-Position: refs/heads/master@{#427141}

Powered by Google App Engine
This is Rietveld 408576698