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

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

Issue 1369213002: Revert of Replace RawPtr with RefPtr on StylePendingImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 31d07bf1d437803c7d60d0ac79346a068c0f034f..c6b5c009ce9fa2b1a504ac5e886e6ee26952404a 100644
--- a/third_party/WebKit/Source/core/css/CSSImageSetValue.h
+++ b/third_party/WebKit/Source/core/css/CSSImageSetValue.h
@@ -46,12 +46,15 @@
}
~CSSImageSetValue();
- bool isCachePending(float deviceScaleFactor) const;
- StyleImage* cachedImageSet(float deviceScaleFactor);
- StyleFetchedImageSet* cacheImageSet(Document*, float deviceScaleFactor, const ResourceLoaderOptions&);
- StyleFetchedImageSet* cacheImageSet(Document*, float deviceScaleFactor);
+ 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);
String customCSSText() const;
+
+ bool isPending() const { return !m_accessedBestFitImage; }
struct ImageWithScale {
ALLOW_ONLY_INLINE_ALLOCATION();
@@ -67,7 +70,7 @@
DECLARE_TRACE_AFTER_DISPATCH();
protected:
- ImageWithScale bestImageForScaleFactor(float scaleFactor);
+ ImageWithScale bestImageForScaleFactor();
private:
CSSImageSetValue();
@@ -75,9 +78,12 @@
void fillImageSet();
static inline bool compareByScaleFactor(ImageWithScale first, ImageWithScale second) { return first.scaleFactor < second.scaleFactor; }
- bool m_isCachePending;
- float m_cachedScaleFactor;
- RefPtrWillBeMember<StyleImage> m_cachedImageSet;
+ 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;
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