Cancel image loads if decoding failed (attempt #2)

'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
TBR=peter@chromium.org

Review-Url: https://codereview.chromium.org/2173873003
Cr-Commit-Position: refs/heads/master@{#407555}
25 files changed