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

Unified Diff: third_party/WebKit/Source/core/loader/resource/ImageResource.h

Issue 2650113002: Phase II Step 2: Remove setIsPlaceholder() in updateImage() (Closed)
Patch Set: compile fix Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.;

Powered by Google App Engine
This is Rietveld 408576698