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

Unified Diff: third_party/WebKit/Source/core/fetch/ImageResource.h

Issue 2361263003: Blink: Throttle progressively loaded images. (Closed)
Patch Set: land: rebase Created 4 years, 1 month 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/fetch/ImageResource.h
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.h b/third_party/WebKit/Source/core/fetch/ImageResource.h
index da11324a76b75831bae1dbdf4ee8ecf76740af09..3a7c81076e9667e8cca6b2d7a17227acad038e0f 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.h
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.h
@@ -29,6 +29,7 @@
#include "platform/geometry/IntRect.h"
#include "platform/geometry/IntSizeHash.h"
#include "platform/geometry/LayoutSize.h"
+#include "platform/graphics/Image.h"
#include "platform/graphics/ImageObserver.h"
#include "platform/graphics/ImageOrientation.h"
#include "wtf/HashMap.h"
@@ -200,6 +201,8 @@ class CORE_EXPORT ImageResource final
void destroyDecodedDataIfPossible() override;
void destroyDecodedDataForFailedRevalidation() override;
+ void flushImageIfNeeded(TimerBase*);
+
float m_devicePixelRatioHeaderValue;
Member<MultipartImageResourceParser> m_multipartParser;
@@ -217,6 +220,10 @@ 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;
+
+ Timer<ImageResource> m_flushTimer;
+ double m_lastFlushTime = 0.;
+ Image::SizeAvailability m_sizeAvailable = Image::SizeUnavailable;
};
DEFINE_RESOURCE_TYPE_CASTS(Image);

Powered by Google App Engine
This is Rietveld 408576698