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

Unified Diff: third_party/WebKit/Source/core/css/CSSImageSetValue.h

Issue 1368613002: Replace RawPtr with RefPtr on StylePendingImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix image set caching logic Created 5 years, 3 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/css/CSSImageSetValue.h
diff --git a/third_party/WebKit/Source/core/css/CSSImageSetValue.h b/third_party/WebKit/Source/core/css/CSSImageSetValue.h
index c6b5c009ce9fa2b1a504ac5e886e6ee26952404a..31d07bf1d437803c7d60d0ac79346a068c0f034f 100644
--- a/third_party/WebKit/Source/core/css/CSSImageSetValue.h
+++ b/third_party/WebKit/Source/core/css/CSSImageSetValue.h
@@ -46,16 +46,13 @@ public:
}
~CSSImageSetValue();
- StyleFetchedImageSet* cachedImageSet(Document*, float deviceScaleFactor, const ResourceLoaderOptions&);
- StyleFetchedImageSet* cachedImageSet(Document*, float deviceScaleFactor);
-
- // Returns a StyleFetchedImageSet if the best fit image has been cached already, otherwise a StylePendingImage.
- StyleImage* cachedOrPendingImageSet(float);
+ bool isCachePending(float deviceScaleFactor) const;
+ StyleImage* cachedImageSet(float deviceScaleFactor);
+ StyleFetchedImageSet* cacheImageSet(Document*, float deviceScaleFactor, const ResourceLoaderOptions&);
+ StyleFetchedImageSet* cacheImageSet(Document*, float deviceScaleFactor);
String customCSSText() const;
- bool isPending() const { return !m_accessedBestFitImage; }
-
struct ImageWithScale {
ALLOW_ONLY_INLINE_ALLOCATION();
String imageURL;
@@ -70,7 +67,7 @@ public:
DECLARE_TRACE_AFTER_DISPATCH();
protected:
- ImageWithScale bestImageForScaleFactor();
+ ImageWithScale bestImageForScaleFactor(float scaleFactor);
private:
CSSImageSetValue();
@@ -78,12 +75,9 @@ private:
void fillImageSet();
static inline bool compareByScaleFactor(ImageWithScale first, ImageWithScale second) { return first.scaleFactor < second.scaleFactor; }
- RefPtrWillBeMember<StyleImage> m_imageSet;
- bool m_accessedBestFitImage;
-
- // This represents the scale factor that we used to find the best fit image. It does not necessarily
- // correspond to the scale factor of the best fit image.
- float m_scaleFactor;
+ bool m_isCachePending;
+ float m_cachedScaleFactor;
+ RefPtrWillBeMember<StyleImage> m_cachedImageSet;
Vector<ImageWithScale> m_imagesInSet;
};
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp ('k') | third_party/WebKit/Source/core/css/CSSImageSetValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698