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

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

Issue 1387113002: Change StyleResolverState.styleImage() to take a const CSSValue& (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added TODOs to replace the members with const members Created 5 years, 2 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/resolver/ElementStyleResources.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp b/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp
index ee98b054782ca92094143b1f425b54fce2827e00..e7c97033812eedc79e26e428fdb11b7d3a73a6ef 100644
--- a/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp
@@ -39,58 +39,58 @@ ElementStyleResources::ElementStyleResources()
{
}
-PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::styleImage(Document& document, CSSPropertyID property, CSSValue* value)
+PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::styleImage(Document& document, CSSPropertyID property, const CSSValue& value)
{
- if (value->isImageValue())
+ if (value.isImageValue())
return cachedOrPendingFromValue(document, property, toCSSImageValue(value));
- if (value->isImageGeneratorValue())
+ if (value.isImageGeneratorValue())
return generatedOrPendingFromValue(property, toCSSImageGeneratorValue(value));
- if (value->isImageSetValue())
+ if (value.isImageSetValue())
return setOrPendingFromValue(property, toCSSImageSetValue(value));
- if (value->isCursorImageValue())
+ if (value.isCursorImageValue())
return cursorOrPendingFromValue(property, toCSSCursorImageValue(value));
return nullptr;
}
-PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::generatedOrPendingFromValue(CSSPropertyID property, CSSImageGeneratorValue* value)
+PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::generatedOrPendingFromValue(CSSPropertyID property, const CSSImageGeneratorValue& value)
{
- if (value->isPending()) {
+ if (value.isPending()) {
m_pendingImageProperties.add(property);
return StylePendingImage::create(value);
}
return StyleGeneratedImage::create(value);
}
-PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::setOrPendingFromValue(CSSPropertyID property, CSSImageSetValue* value)
+PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::setOrPendingFromValue(CSSPropertyID property, const CSSImageSetValue& value)
{
- if (value->isCachePending(m_deviceScaleFactor)) {
+ if (value.isCachePending(m_deviceScaleFactor)) {
m_pendingImageProperties.add(property);
return StylePendingImage::create(value);
}
- return value->cachedImageSet(m_deviceScaleFactor);
+ return value.cachedImageSet(m_deviceScaleFactor);
}
-PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::cachedOrPendingFromValue(Document& document, CSSPropertyID property, CSSImageValue* value)
+PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::cachedOrPendingFromValue(Document& document, CSSPropertyID property, const CSSImageValue& value)
{
- if (value->isCachePending()) {
+ if (value.isCachePending()) {
m_pendingImageProperties.add(property);
return StylePendingImage::create(value);
}
- value->restoreCachedResourceIfNeeded(document);
- return value->cachedImage();
+ value.restoreCachedResourceIfNeeded(document);
+ return value.cachedImage();
}
-PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::cursorOrPendingFromValue(CSSPropertyID property, CSSCursorImageValue* value)
+PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::cursorOrPendingFromValue(CSSPropertyID property, const CSSCursorImageValue& value)
{
- if (value->isCachePending(m_deviceScaleFactor)) {
+ if (value.isCachePending(m_deviceScaleFactor)) {
m_pendingImageProperties.add(property);
return StylePendingImage::create(value);
}
- return value->cachedImage(m_deviceScaleFactor);
+ return value.cachedImage(m_deviceScaleFactor);
}
void ElementStyleResources::clearPendingImageProperties()

Powered by Google App Engine
This is Rietveld 408576698