| Index: third_party/WebKit/Source/core/loader/resource/ImageResource.h
|
| diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResource.h b/third_party/WebKit/Source/core/loader/resource/ImageResource.h
|
| index accceb9a300b15c662f74e03652a1f8f0cc91770..6ad11afdf18bec6543e30f40563e903c973f9579 100644
|
| --- a/third_party/WebKit/Source/core/loader/resource/ImageResource.h
|
| +++ b/third_party/WebKit/Source/core/loader/resource/ImageResource.h
|
| @@ -95,8 +95,7 @@ class CORE_EXPORT ImageResource final
|
| void onePartInMultipartReceived(const ResourceResponse&) final;
|
| void multipartDataReceived(const char*, size_t) final;
|
|
|
| - // Used by tests.
|
| - bool isPlaceholder() const { return m_isPlaceholder; }
|
| + bool shouldShowPlaceholder() const;
|
|
|
| DECLARE_VIRTUAL_TRACE();
|
|
|
| @@ -135,11 +134,7 @@ class CORE_EXPORT ImageResource final
|
|
|
| void flushImageIfNeeded(TimerBase*);
|
|
|
| - bool shouldReloadBrokenPlaceholder() const {
|
| - return m_isPlaceholder && willPaintBrokenImage();
|
| - }
|
| -
|
| - bool willPaintBrokenImage() const;
|
| + bool shouldReloadBrokenPlaceholder() const;
|
|
|
| Member<ImageResourceContent> m_content;
|
|
|
| @@ -159,7 +154,17 @@ class CORE_EXPORT ImageResource final
|
|
|
| // Indicates if this ImageResource is either attempting to load a placeholder
|
| // image, or is a (possibly broken) placeholder image.
|
| - bool m_isPlaceholder;
|
| + enum class PlaceholderOption {
|
| + // Do not show or reload placeholder.
|
| + DoNotReloadPlaceholder,
|
| +
|
| + // Do not show placeholder, reload only when decode error occurs.
|
| + ReloadPlaceholderOnDecodeError,
|
| +
|
| + // Show placeholder and reload.
|
| + ShowAndReloadPlaceholderAlways,
|
| + };
|
| + PlaceholderOption m_placeholderOption;
|
|
|
| Timer<ImageResource> m_flushTimer;
|
| double m_lastFlushTime = 0.;
|
|
|