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

Issue 2535383003: Collapse images disallowed by the Safe Browsing Subresource Filter. (Closed)

Created:
4 years ago by engedy
Modified:
4 years ago
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-animation_chromium.org, blink-reviews-html_chromium.org, caseq+blink_chromium.org, chromium-reviews, devtools-reviews_chromium.org, dglazkov+blink, Eric Willigers, gavinp+loader_chromium.org, Nate Chapin, kozyatinskiy+blink_chromium.org, loading-reviews_chromium.org, loading-reviews+fetch_chromium.org, lushnikov+blink_chromium.org, mounir_chromium.org, pfeldman+blink_chromium.org, rjwright, shans, tyoshino+watch_chromium.org, Yoav Weiss
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Collapse images disallowed by the Safe Browsing Subresource Filter. When the ImageResource being loaded into an HTMLImageElement is disallowed by subresource filtering, the element is now collapsed in the layout (instead of showing fallback content). This is achieved by the following changes: 1) Internally, access check related methods in FetchContext, ResourceLoader and ResourceFetcher have been refactored so that they now return a ResourceRequestBlockedReason enumerator instead of a boolean value. 2) ResourceError now has an |m_shouldCollapseInitiator| field. When a load is disallowed because of subresource filtering, the ResourceError instance set on the failed Resource will now has this boolean set. 3) HTMLImageElement now has three states: showing primary content, showing fallback content, and collapsed. When the |m_shouldCollapseInitiator| is set on its ImageResource, it enters this new, third state. BUG=609747 Committed: https://crrev.com/3c67d0c8a79c59b3afa1d73761387fb3be82a0bd Cr-Commit-Position: refs/heads/master@{#436917}

Patch Set 1 : Initial draft. #

Total comments: 6

Patch Set 2 : Addressed comments from mkwst@. #

Patch Set 3 : Avoid infinitely nested fallback images. #

Patch Set 4 : Phrasing. #

Total comments: 28

Patch Set 5 : Addressed comments from dominicc@. #

Patch Set 6 : Remove ref-tests, fix generated content. #

Total comments: 7

Patch Set 7 : Second round of comments from dominicc@. #

Patch Set 8 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+530 lines, -198 lines) Patch
A third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/fallback-image-moved-across-documents.html View 1 2 3 4 5 1 chunk +45 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/subresource_filter/image-allow-disallow-transitions.html View 1 2 3 4 5 1 chunk +77 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/subresource_filter/image-disallowed.html View 1 2 3 4 1 chunk +38 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/subresource_filter/image-disallowed-after-redirect.html View 1 2 3 4 1 chunk +38 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/subresource_filter/picture-disallowed.html View 1 2 3 4 1 chunk +55 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/subresource_filter/resources/alpha.png View Binary file 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/subresource_filter/resources/beta.png View Binary file 0 comments Download
M third_party/WebKit/Source/core/fetch/FetchContext.h View 3 chunks +15 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ImageResource.cpp View 1 2 1 chunk +8 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp View 1 2 1 chunk +8 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/MockFetchContext.h View 1 chunk +8 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcher.h View 1 2 3 4 5 6 7 3 chunks +7 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp View 1 2 3 4 5 6 7 8 chunks +49 lines, -36 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceLoader.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceLoader.cpp View 1 2 3 chunks +15 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLImageElement.h View 1 2 3 4 5 6 7 5 chunks +21 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLImageElement.cpp View 1 2 3 4 5 6 7 6 chunks +63 lines, -37 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLImageLoader.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLImageLoader.cpp View 3 chunks +9 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp View 1 2 1 chunk +7 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContext.h View 1 2 3 4 5 6 7 2 chunks +12 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContext.cpp View 1 2 3 4 5 6 7 9 chunks +25 lines, -29 lines 0 comments Download
M third_party/WebKit/Source/platform/network/ResourceError.h View 6 chunks +15 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/network/ResourceError.cpp View 2 chunks +5 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/network/ResourceRequest.h View 1 chunk +8 lines, -8 lines 0 comments Download

Messages

Total messages: 57 (43 generated)
engedy
Hey @Mike, @Nate, could you see the CL description, and please take an initial look? ...
4 years ago (2016-11-30 15:15:06 UTC) #7
Mike West
I like this. And Nate is OOO, so let's land it and see what explodes. ...
4 years ago (2016-11-30 15:57:35 UTC) #8
engedy
@Dominic, would you be the right person to review changes to: third_party/WebKit/Source/core/html/?
4 years ago (2016-11-30 16:41:43 UTC) #12
engedy
https://codereview.chromium.org/2535383003/diff/20001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/2535383003/diff/20001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#newcode91 third_party/WebKit/Source/core/fetch/ImageResource.cpp:91: ResourceRequestBlockedReason::None) { On 2016/11/30 15:57:35, Mike West (slow) wrote: ...
4 years ago (2016-11-30 17:37:39 UTC) #15
engedy
Okay, infinitely nested fallback content fixed. I added regression test for good measure, although I'm ...
4 years ago (2016-12-01 22:20:15 UTC) #26
dominicc (has gone to gerrit)
Sorry for the slow response, some comments inline. Mounir, is media team interested in reviewing ...
4 years ago (2016-12-05 03:30:56 UTC) #29
engedy
All done, please take another look. https://codereview.chromium.org/2535383003/diff/120001/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/fallback-image-moved-across-documents-expected.html File third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/fallback-image-moved-across-documents-expected.html (right): https://codereview.chromium.org/2535383003/diff/120001/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/fallback-image-moved-across-documents-expected.html#newcode3 third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/fallback-image-moved-across-documents-expected.html:3: <img src="non-existent"> On ...
4 years ago (2016-12-06 15:27:57 UTC) #32
dominicc (has gone to gerrit)
Splendid work. core/html LGTM modulo some trivial suggestions inline. https://codereview.chromium.org/2535383003/diff/160001/third_party/WebKit/Source/core/html/HTMLImageElement.cpp File third_party/WebKit/Source/core/html/HTMLImageElement.cpp (right): https://codereview.chromium.org/2535383003/diff/160001/third_party/WebKit/Source/core/html/HTMLImageElement.cpp#newcode357 third_party/WebKit/Source/core/html/HTMLImageElement.cpp:357: ...
4 years ago (2016-12-07 01:51:42 UTC) #39
engedy
https://codereview.chromium.org/2535383003/diff/160001/third_party/WebKit/Source/core/html/HTMLImageElement.cpp File third_party/WebKit/Source/core/html/HTMLImageElement.cpp (right): https://codereview.chromium.org/2535383003/diff/160001/third_party/WebKit/Source/core/html/HTMLImageElement.cpp#newcode357 third_party/WebKit/Source/core/html/HTMLImageElement.cpp:357: switch (m_layoutDisposition) { On 2016/12/07 01:51:42, dominicc wrote: > ...
4 years ago (2016-12-07 09:37:41 UTC) #42
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/2535383003/180001
4 years ago (2016-12-07 09:44:51 UTC) #47
commit-bot: I haz the power
Failed to apply patch for third_party/WebKit/Source/core/fetch/ResourceFetcher.h: While running git apply --index -p1; error: patch failed: ...
4 years ago (2016-12-07 10:05:50 UTC) #49
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/2535383003/200001
4 years ago (2016-12-07 10:21:03 UTC) #52
commit-bot: I haz the power
Committed patchset #8 (id:200001)
4 years ago (2016-12-07 11:49:44 UTC) #55
commit-bot: I haz the power
4 years ago (2016-12-07 11:51:27 UTC) #57
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/3c67d0c8a79c59b3afa1d73761387fb3be82a0bd
Cr-Commit-Position: refs/heads/master@{#436917}

Powered by Google App Engine
This is Rietveld 408576698