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

Issue 2552653002: Explicitly clear the image in the first updateImage() call (Closed)

Created:
4 years ago by hiroshige
Modified:
3 years, 10 months ago
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

Explicitly clear the image in the first updateImage() call Previously, updateImage() called in appendData()/finish()/error() creates a new blink::Image only when the given SharedBuffer is non-empty and |m_image| is nullptr. However, this requires |m_image| to be cleared to enforce a new image creation in LoFi/placeholder image reloading and would complicate refactoring of LoFi reloading in https://codereview.chromium.org/2527353002. This CL makes ImageResource to explicitly use ClearAndUpdateImage when calling updateImage() for the first time for a corresponding response (or a corresponding part in case of a multipart image). As a result, we no longer need to clear |m_image| when reloading LoFi images. BUG=667641

Patch Set 1 #

Total comments: 1

Patch Set 2 : Rebase #

Patch Set 3 : Rebase #

Patch Set 4 : Rebase #

Patch Set 5 : Rebase after toyoshim #

Patch Set 6 : Rebase #

Patch Set 7 : Rebase #

Patch Set 8 : Rebase #

Total comments: 2

Patch Set 9 : Rebase #

Patch Set 10 : Rename flag name #

Patch Set 11 : Rebase #

Patch Set 12 : Rebase #

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

Depends on Patchset:

Messages

Total messages: 40 (30 generated)
hiroshige
PTAL.
4 years ago (2016-12-05 09:19:53 UTC) #5
hajimehoshi
https://codereview.chromium.org/2552653002/diff/1/third_party/WebKit/Source/core/fetch/ImageResource.h File third_party/WebKit/Source/core/fetch/ImageResource.h (right): https://codereview.chromium.org/2552653002/diff/1/third_party/WebKit/Source/core/fetch/ImageResource.h#newcode27 third_party/WebKit/Source/core/fetch/ImageResource.h:27: #include "core/fetch/ImageResourceContent.h" I couldn't find this file.
4 years ago (2016-12-06 07:26:00 UTC) #8
yhirano
lgtm
4 years ago (2016-12-13 12:28:19 UTC) #17
hiroshige
Rebased after toyoshim's directory move and https://codereview.chromium.org/2587503002. PTAL again.
4 years ago (2016-12-16 22:52:56 UTC) #25
kouhei (in TOK)
https://codereview.chromium.org/2552653002/diff/140001/third_party/WebKit/Source/core/loader/resource/ImageResource.h File third_party/WebKit/Source/core/loader/resource/ImageResource.h (right): https://codereview.chromium.org/2552653002/diff/140001/third_party/WebKit/Source/core/loader/resource/ImageResource.h#newcode152 third_party/WebKit/Source/core/loader/resource/ImageResource.h:152: bool m_isUpdateImageCalled = false; This flag name is quite ...
4 years ago (2016-12-19 01:32:04 UTC) #31
kouhei (in TOK)
On 2016/12/19 01:32:04, kouhei wrote: > https://codereview.chromium.org/2552653002/diff/140001/third_party/WebKit/Source/core/loader/resource/ImageResource.h > File third_party/WebKit/Source/core/loader/resource/ImageResource.h (right): > > https://codereview.chromium.org/2552653002/diff/140001/third_party/WebKit/Source/core/loader/resource/ImageResource.h#newcode152 > ...
4 years ago (2016-12-19 01:33:50 UTC) #32
hiroshige
https://codereview.chromium.org/2552653002/diff/140001/third_party/WebKit/Source/core/loader/resource/ImageResource.h File third_party/WebKit/Source/core/loader/resource/ImageResource.h (right): https://codereview.chromium.org/2552653002/diff/140001/third_party/WebKit/Source/core/loader/resource/ImageResource.h#newcode152 third_party/WebKit/Source/core/loader/resource/ImageResource.h:152: bool m_isUpdateImageCalled = false; On 2016/12/19 01:32:04, kouhei wrote: ...
3 years, 11 months ago (2016-12-27 23:25:31 UTC) #35
kouhei (in TOK)
lgtm
3 years, 11 months ago (2016-12-30 01:45:56 UTC) #38
hajimehoshi
lgtm
3 years, 11 months ago (2017-01-10 06:39:13 UTC) #39
hiroshige
3 years, 10 months ago (2017-01-25 02:53:10 UTC) #40
Thanks for reviewing.

However, I intended to use this CL in order to change the timing of clearing
m_image of ImageResourceContent in reloading, but I found a problem there, and I
changed my mind.
Now I'll keep the timing of clearing m_image there, and thus this CL is not
needed by that CL.

Therefore I close this CL uncommitted.

Powered by Google App Engine
This is Rietveld 408576698