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

Unified Diff: third_party/WebKit/Source/core/css/CSSImageValue.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/CSSImageValue.h
diff --git a/third_party/WebKit/Source/core/css/CSSImageValue.h b/third_party/WebKit/Source/core/css/CSSImageValue.h
index 003d89996e49e13e69c7cec161be4fabb0d9d492..649737966d36a02ce83dac3e9c8dbbc41ad55ec5 100644
--- a/third_party/WebKit/Source/core/css/CSSImageValue.h
+++ b/third_party/WebKit/Source/core/css/CSSImageValue.h
@@ -50,10 +50,10 @@ public:
}
~CSSImageValue();
- StyleFetchedImage* cachedImage(Document*, const ResourceLoaderOptions&);
- StyleFetchedImage* cachedImage(Document* document) { return cachedImage(document, ResourceFetcher::defaultResourceOptions()); }
- // Returns a StyleFetchedImage if the image is cached already, otherwise a StylePendingImage.
- StyleImage* cachedOrPendingImage();
+ bool isCachePending() const { return m_isCachePending; }
+ StyleImage* cachedImage() { ASSERT(!isCachePending()); return m_cachedImage.get(); }
+ StyleFetchedImage* cacheImage(Document*, const ResourceLoaderOptions&);
+ StyleFetchedImage* cacheImage(Document* document) { return cacheImage(document, ResourceFetcher::defaultResourceOptions()); }
const String& url() { return m_absoluteURL; }
@@ -72,7 +72,7 @@ public:
PassRefPtrWillBeRawPtr<CSSImageValue> valueWithURLMadeAbsolute()
{
- return create(KURL(ParsedURLString, m_absoluteURL), m_image.get());
+ return create(KURL(ParsedURLString, m_absoluteURL), m_cachedImage.get());
}
void setInitiator(const AtomicString& name) { m_initiatorName = name; }
@@ -86,8 +86,8 @@ private:
AtomicString m_relativeURL;
AtomicString m_absoluteURL;
Referrer m_referrer;
- RefPtrWillBeMember<StyleImage> m_image;
- bool m_accessedImage;
+ bool m_isCachePending;
+ RefPtrWillBeMember<StyleImage> m_cachedImage;
AtomicString m_initiatorName;
};
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSImageSetValue.cpp ('k') | third_party/WebKit/Source/core/css/CSSImageValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698