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

Unified Diff: Source/core/css/resolver/ElementStyleResources.cpp

Issue 1308953009: Move Image ownership out of CSSValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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
« no previous file with comments | « Source/core/css/resolver/ElementStyleResources.h ('k') | Source/core/css/resolver/StyleResourceLoader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/ElementStyleResources.cpp
diff --git a/Source/core/css/resolver/ElementStyleResources.cpp b/Source/core/css/resolver/ElementStyleResources.cpp
index 4b6ba321da54dcf7230009dabaeb9c6e77e76609..b6d68ad28b4e3bf103330cb9e24495656df5b21a 100644
--- a/Source/core/css/resolver/ElementStyleResources.cpp
+++ b/Source/core/css/resolver/ElementStyleResources.cpp
@@ -56,7 +56,7 @@ PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::styleImage(Document& d
PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::generatedOrPendingFromValue(CSSPropertyID property, CSSImageGeneratorValue* value)
{
- if (value->isPending()) {
+ if (value->isPending(mutableCssImages())) {
m_pendingImageProperties.set(property, value);
return StylePendingImage::create(value);
}
@@ -73,19 +73,18 @@ PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::setOrPendingFromValue(
PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::cachedOrPendingFromValue(Document& document, CSSPropertyID property, CSSImageValue* value)
{
- RefPtrWillBeRawPtr<StyleImage> image = value->cachedOrPendingImage();
- if (image) {
- if (image->isPendingImage())
- m_pendingImageProperties.set(property, value);
- else
- value->restoreCachedResourceIfNeeded(document);
- }
+ RefPtrWillBeRawPtr<StyleImage> image = value->cachedOrPendingImage(mutableCssImages());
+ ASSERT(image);
+ if (image->isPendingImage())
+ m_pendingImageProperties.set(property, value);
+ else
+ value->restoreCachedResourceIfNeeded(document, mutableCssImages());
return image.release();
}
PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::cursorOrPendingFromValue(CSSPropertyID property, CSSCursorImageValue* value)
{
- RefPtrWillBeRawPtr<StyleImage> image = value->cachedOrPendingImage(m_deviceScaleFactor);
+ RefPtrWillBeRawPtr<StyleImage> image = value->cachedOrPendingImage(mutableCssImages(), m_deviceScaleFactor);
if (image && image->isPendingImage())
m_pendingImageProperties.set(property, value);
return image.release();
@@ -101,6 +100,13 @@ void ElementStyleResources::clearPendingSVGDocuments()
m_pendingSVGDocuments.clear();
}
+void ElementStyleResources::clearCSSImages()
+{
+ printf("ElementStyleResources clearing\n");
+ m_cssImages.clear();
+ printf("ElementStyleResources cleared\n");
+}
+
void ElementStyleResources::addPendingSVGDocument(FilterOperation* filterOperation, CSSSVGDocumentValue* cssSVGDocumentValue)
{
m_pendingSVGDocuments.set(filterOperation, cssSVGDocumentValue);
« no previous file with comments | « Source/core/css/resolver/ElementStyleResources.h ('k') | Source/core/css/resolver/StyleResourceLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698