Chromium Code Reviews| 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..0771ac70155f4dee62d5677bf74a772bf0450a0f 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 PlaceholderOption { |
|
yhirano
2017/02/13 11:36:57
enum class?
hiroshige
2017/02/23 20:52:38
Done.
|
| + // 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.; |