Currently, ImageResource is
- A part of Image, as a kind of a wrapper of blink::Image and
  the entry point of ImageResourceObserver, and
- A part of Resource, because it is a subclass of Resource and highly
  involved into internals of Resource such as state control of Resource.
This complicates the ImageResource, causes dependencies and
layering violation between loading- and image-related things, and
complicates reloading logic.

This CL splits ImageResource into two parts:
ImageResource, the Resource-part:
- A subclass of Resource.
ImageResourceContent, the Image-part:
- Manages blink::Image and ImageResourceObserver, and inherits ImageObserver.
- Has limited access to Resource-part (if any) via ImageResourceInfo.

Most of current users of ImageResource, especially those in core/style, are
migrated to use ImageResourceContent and/or
to inherit ImageResourceObserver instead of ResourceClient,
as they want to access Image, not necessarily resource loading.

Design doc:
https://docs.google.com/document/d/1O-fB83mrE0B_V8gzXNqHgmRLCvstTB4MMi3RnVLr8bE/edit?usp=sharing

In this CL, the Resource-part and the Image-part has 1:1 correspondence that
doesn't change during their lifetime and therefore ImageResource::m_content
is always non-null.
Subsequent CLs will make them detachable.

Changes in most of the files are replacing ImageResource with
ImageResourceContent.
Notable changes are:

Main part of CL: split ImageResource into two parts:
- core/fetch/ImageResource.h
- core/fetch/ImageResource.cpp
- core/fetch/ImageResourceContent.h
- core/fetch/ImageResourceContent.cpp

emulateLoadStartedForInspector() hack is now called via ImageResourceContent:
- core/css/CSSImageValue.cpp

ImageLoader is mostly migrated to ImageResourceContent, except for
imageResourceForImageDocument() that returns ImageResource only for
ImageDocument.
- core/html/HTMLImageElement.h
- core/html/ImageDocument.cpp
- core/loader/ImageLoader.h
- core/loader/ImageLoader.cpp

A reference to Resource from FrameSerializer is replaced with |mimeType|
String and |hasCacheControlNoStoreHeader| boolean in order to migrate to
ImageResourceContent.
- web/WebFrameSerializer.cpp
- core/frame/FrameSerializer.h
- core/frame/FrameSerializer.cpp

BUG=667641

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2469873002
Cr-Commit-Position: refs/heads/master@{#437867}
74 files changed