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

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

Issue 2650113002: Phase II Step 2: Remove setIsPlaceholder() in updateImage() (Closed)
Patch Set: Rebase. 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/resource/ImageResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/resource/ImageResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698