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

Issue 2746343002: Phase III Step 1: Make ImageResourceContent manage its own ResourceStatus (Closed)

Created:
3 years, 9 months ago by hiroshige
Modified:
3 years, 7 months ago
CC:
chromium-reviews, blink-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Make ImageResourceContent manage its own ResourceStatus Design doc: https://docs.google.com/document/d/1O-fB83mrE0B_V8gzXNqHgmRLCvstTB4MMi3RnVLr8bE/edit# 1. This CL - Adds ImageResourceContent::content_status_, - Renames ImageResourceContent::GetStatus() to GetContentStatus(), and - Makes them updated independently from Resource::status_/GetStatus(). This is to decouple GetStatus() timing dependencies between ImageResource and ImageResourceContent, particularly to allow ImageResourceContent::GetContentStatus() to be changed to kCached (in https://codereview.chromium.org/2613853002/) when SVG image loading is really finished, not necessarily when ResourceLoader is finished. 2. In order to change the content state to kPending when loading is started, NotifyStartLoad() notifications are introduced. 3. Stricter assertions are added to |content_status_| transitions. |SetStatus(kPending)| and NotifyStartLoad() calls are added to non-ResourceLoader paths to make the state transition consistent. 4. This CL makes ImageResourceContent::GetContentStatus() to be kCached before ImageNotifyFinished() is called in successful loading, while Resource::GetStatus() is kPending at that time. BUG=667641, 382170, 690480 Review-Url: https://codereview.chromium.org/2746343002 Cr-Commit-Position: refs/heads/master@{#470104} Committed: https://chromium.googlesource.com/chromium/src/+/ebd2fa73e3046f3d6397545285a41fa1d78c4be8

Patch Set 1 #

Patch Set 2 : Resurrect notifyStartLoad(); should be failing #

Patch Set 3 : ImageResourceContent::notifyLoad() #

Patch Set 4 : Rewind #

Total comments: 17

Patch Set 5 : Reflect comments #

Patch Set 6 : Rebase after Blink Renaming #

Patch Set 7 : Fix tests, asserts #

Patch Set 8 : Refine, rename #

Patch Set 9 : minor #

Patch Set 10 : Refine #

Patch Set 11 : Refine #

Patch Set 12 : fix #

Patch Set 13 : Rebase #

Total comments: 6

Patch Set 14 : Reflect comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+211 lines, -69 lines) Patch
M third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLObjectElement.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/ImageLoader.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResource.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -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 12 13 4 chunks +10 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +23 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp View 1 2 3 4 5 6 7 8 9 5 chunks +94 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResourceInfo.h View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp View 1 2 3 4 5 6 7 chunks +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/resource/MockImageResourceObserver.cpp View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 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 2 chunks +17 lines, -12 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 4 chunks +51 lines, -31 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebFrameTest.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 69 (58 generated)
hiroshige
PTAL.
3 years, 9 months ago (2017-03-15 00:22:08 UTC) #25
hiroshige
https://codereview.chromium.org/2746343002/diff/60001/third_party/WebKit/Source/core/loader/resource/MockImageResourceObserver.cpp File third_party/WebKit/Source/core/loader/resource/MockImageResourceObserver.cpp (right): https://codereview.chromium.org/2746343002/diff/60001/third_party/WebKit/Source/core/loader/resource/MockImageResourceObserver.cpp#newcode44 third_party/WebKit/Source/core/loader/resource/MockImageResourceObserver.cpp:44: DCHECK(image->isLoaded()); This CL enables this DCHECK(). (Previously this fails ...
3 years, 9 months ago (2017-03-15 00:22:58 UTC) #26
kouhei (in TOK)
https://codereview.chromium.org/2746343002/diff/60001/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp File third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp (right): https://codereview.chromium.org/2746343002/diff/60001/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp#newcode298 third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp:298: // When |ShouldNotifyFinish|, we set |m_status| to a loaded ...
3 years, 9 months ago (2017-03-15 11:18:53 UTC) #27
yhirano
https://codereview.chromium.org/2746343002/diff/60001/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp File third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp (right): https://codereview.chromium.org/2746343002/diff/60001/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp#newcode314 third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp:314: if (m_status == ResourceStatus::NotStarted) Is |status| arbitrary here? Can ...
3 years, 9 months ago (2017-03-17 13:47:25 UTC) #28
hiroshige
Restarting the activity. Main changes since last review comments: - Renamed ImageResourceContent::status_/GetStatus() to content_status_/GetContentStatus(). - ...
3 years, 7 months ago (2017-05-04 20:21:57 UTC) #44
yhirano
LGTM "Make ImageResourceContent to manage its own ResourceStatus" "to" is not needed? https://codereview.chromium.org/2746343002/diff/240001/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp File third_party/WebKit/Source/core/loader/resource/ImageResource.cpp ...
3 years, 7 months ago (2017-05-08 05:28:52 UTC) #53
kouhei (in TOK)
lgtm https://codereview.chromium.org/2746343002/diff/240001/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h File third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h (right): https://codereview.chromium.org/2746343002/diff/240001/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h#newcode107 third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h:107: // ImageResource::getStatus(). Use ImageResourceContent::getContentStatus(). I'd also add link ...
3 years, 7 months ago (2017-05-08 05:36:22 UTC) #54
hiroshige
> "Make ImageResourceContent to manage its own ResourceStatus" > "to" is not needed? Done, https://codereview.chromium.org/2746343002/diff/240001/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp ...
3 years, 7 months ago (2017-05-08 17:08:14 UTC) #58
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/2746343002/260001
3 years, 7 months ago (2017-05-08 17:09:51 UTC) #62
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/2746343002/260001
3 years, 7 months ago (2017-05-08 19:27:24 UTC) #66
commit-bot: I haz the power
3 years, 7 months ago (2017-05-08 20:23:43 UTC) #69
Message was sent while issue was closed.
Committed patchset #14 (id:260001) as
https://chromium.googlesource.com/chromium/src/+/ebd2fa73e3046f3d6397545285a4...

Powered by Google App Engine
This is Rietveld 408576698