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

Issue 2108033003: Cancel image loads if decoding failed. (Closed)

Created:
4 years, 5 months ago by Nate Chapin
Modified:
4 years, 5 months ago
Reviewers:
Peter Beverloo, pdr.
CC:
blink-reviews, chromium-reviews, gavinp+loader_chromium.org, Nate Chapin, loading-reviews+fetch_chromium.org, tyoshino+watch_chromium.org, Yoav Weiss
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Cancel image loads if decoding failed. 'Cancel' isn't really the right word for what this change does. In the event of an image decoding failure, ImageResource will synthesize a call to ResourceLoader::didFinishLoading, killing the actual network request but reporting it as a successful completion to the rest of blink. This matches our traditional behavior of decoding errors looking like a successful resource load (for the most part). This requires some plumbing changes to image decoding, because the decoder selection logic doesn't report why it wasn't able to create an ImageDecoder. It might be because insufficient data has been received to sniff the image type, or it may be that we definitely don't have a valid image type. This change exposes enough information to tell the difference. BUG=471272 Committed: https://crrev.com/520519605b961a7d979bc0eaa3c057a973dc26f1 Cr-Commit-Position: refs/heads/master@{#407171}

Patch Set 1 #

Patch Set 2 : Plumb image decoder state #

Patch Set 3 : compile fix #

Patch Set 4 : <= -> < #

Patch Set 5 : test fixes #

Patch Set 6 : Rebase #

Total comments: 6

Patch Set 7 : Sniff image type in a separate step from ImageDecoder creation #

Total comments: 4

Patch Set 8 : SizeAvailability enum #

Unified diffs Side-by-side diffs Delta from patch set Stats (+137 lines, -79 lines) Patch
M third_party/WebKit/Source/core/fetch/ImageResource.cpp View 1 2 3 4 5 6 7 2 chunks +15 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp View 1 2 3 4 5 6 1 chunk +16 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/Resource.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImage.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp View 1 2 3 4 5 6 7 3 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/exported/WebImage.cpp View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/BitmapImage.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/BitmapImage.cpp View 1 2 3 4 5 6 7 2 chunks +9 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTestWoPlatform.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/Image.h View 1 2 3 4 5 6 7 1 chunk +6 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Image.cpp View 1 2 3 4 5 6 7 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp View 1 2 3 4 5 6 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageSource.h View 1 2 3 4 5 6 3 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageSource.cpp View 1 2 3 4 5 6 1 chunk +5 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h View 1 2 3 4 5 6 2 chunks +16 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp View 1 2 3 4 5 6 1 chunk +38 lines, -22 lines 0 comments Download

Messages

Total messages: 44 (30 generated)
Nate Chapin
pdr, are you a good reviewer for this?
4 years, 5 months ago (2016-07-19 21:29:49 UTC) #16
pdr.
Sorry for the delay, I was out sick yesterday. Excellent change description but please wrap ...
4 years, 5 months ago (2016-07-20 20:39:16 UTC) #17
Nate Chapin
https://codereview.chromium.org/2108033003/diff/100001/third_party/WebKit/Source/platform/graphics/ImageSource.cpp File third_party/WebKit/Source/platform/graphics/ImageSource.cpp (right): https://codereview.chromium.org/2108033003/diff/100001/third_party/WebKit/Source/platform/graphics/ImageSource.cpp#newcode65 third_party/WebKit/Source/platform/graphics/ImageSource.cpp:65: // If enough data has been received to know ...
4 years, 5 months ago (2016-07-20 22:50:00 UTC) #21
pdr.
Much easier to follow with your cleanup! LGTM with or without two further suggestions. https://codereview.chromium.org/2108033003/diff/120001/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp ...
4 years, 5 months ago (2016-07-21 04:39:06 UTC) #24
Nate Chapin
https://codereview.chromium.org/2108033003/diff/120001/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp File third_party/WebKit/Source/platform/graphics/BitmapImage.cpp (right): https://codereview.chromium.org/2108033003/diff/120001/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp#newcode201 third_party/WebKit/Source/platform/graphics/BitmapImage.cpp:201: // If setData() returns InvalidData, we know that this ...
4 years, 5 months ago (2016-07-21 20:59:05 UTC) #27
pdr.
On 2016/07/21 at 20:59:05, japhet wrote: > https://codereview.chromium.org/2108033003/diff/120001/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp > File third_party/WebKit/Source/platform/graphics/BitmapImage.cpp (right): > > https://codereview.chromium.org/2108033003/diff/120001/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp#newcode201 ...
4 years, 5 months ago (2016-07-21 21:41:15 UTC) #28
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/2108033003/140001
4 years, 5 months ago (2016-07-21 22:24:59 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/222798)
4 years, 5 months ago (2016-07-21 22:33:10 UTC) #34
Nate Chapin
peter@, would you mind reviewing the 1-line change to modules/notifications/NotificationImageLoader.cpp ?
4 years, 5 months ago (2016-07-21 22:42:08 UTC) #36
Peter Beverloo
Certainly - lgtm Feel free to TBR this class of changes.
4 years, 5 months ago (2016-07-22 10:53:32 UTC) #37
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/2108033003/140001
4 years, 5 months ago (2016-07-22 16:20:21 UTC) #39
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 5 months ago (2016-07-22 16:25:00 UTC) #41
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/520519605b961a7d979bc0eaa3c057a973dc26f1 Cr-Commit-Position: refs/heads/master@{#407171}
4 years, 5 months ago (2016-07-22 16:26:57 UTC) #43
Mark P
4 years, 5 months ago (2016-07-22 19:16:53 UTC) #44
Message was sent while issue was closed.
A revert of this CL (patchset #8 id:140001) has been created in
https://codereview.chromium.org/2173603003/ by mpearson@chromium.org.

The reason for reverting is: 
Likely cause of failures:

webkit_tests webkit_tests:
http/tests/images/restyle-decode-error.html

https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.11%20%28...

---
10:19:32.937 5109 worker/0 http/tests/images/restyle-decode-error.html started
10:19:32.953 5111 worker/2 accessibility/animation-policy.html passed
10:19:32.955 5111 worker/2
accessibility/anonymous-render-block-in-continuation-causes-crash.html started
10:19:32.999 5109 renderer crash, pid = None, error_line = #CRASHED - renderer
10:19:33.000 5109 killed pid 5357
10:19:33.000 5109 worker/0 http/tests/images/restyle-decode-error.html crashed,
(stderr lines):
10:19:33.000 5109   Received signal 11 <unknown> 000000000000
10:19:33.000 5109    [0x0001196ef23e]
...
10:19:33.002 5109   [end of stack trace]
10:19:33.002 5109  
[5358:13319:0722/101932:598964195783:ERROR:node_controller.cc(1099)] Could not
be introduced to peer C9E4F59A639F0E59.C2F8E762ADA8C89E
10:19:33.006 5084 [4832/40217] http/tests/images/restyle-decode-error.html
failed unexpectedly (renderer crashed)
10:19:33.003 5109 worker/0 killing primary driver
10:19:33.004 5109 worker/0 killing secondary driver
10:19:33.004 5109 worker/0 http/tests/images/restyle-decode-error.html failed:
10:19:33.004 5109 worker/0  renderer crashed
---

Also same failure on other bots such as
https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20Leak/b...

(ignore other webkit failures on this bot; those all have a known cause with a
fix incoming)
.

Powered by Google App Engine
This is Rietveld 408576698