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

Unified Diff: third_party/WebKit/Source/core/svg/SVGElement.cpp

Issue 1541923002: Make SVGElement::propertyFromAttribute return raw pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/svg/SVGElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGElement.cpp
index 03072b003bcbdc1ff58d2bfb4edda6ed5980fa3c..81a4381df3dde32aaadbd659940b176096fcd3e3 100644
--- a/third_party/WebKit/Source/core/svg/SVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGElement.cpp
@@ -277,8 +277,7 @@ static void updateInstancesAnimatedAttribute(SVGElement* element, const Qualifie
{
SVGElement::InstanceUpdateBlocker blocker(element);
for (SVGElement* instance : SVGAnimateElement::findElementInstances(element)) {
- RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> animatedProperty = instance->propertyFromAttribute(attribute);
- if (animatedProperty) {
+ if (SVGAnimatedPropertyBase* animatedProperty = instance->propertyFromAttribute(attribute)) {
callback(*animatedProperty);
instance->invalidateSVGAttributes();
instance->svgAttributeChanged(attribute);
@@ -635,12 +634,10 @@ bool SVGElement::inUseShadowTree() const
void SVGElement::parseAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& value)
{
- RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute(name);
- if (property) {
+ if (SVGAnimatedPropertyBase* property = propertyFromAttribute(name)) {
SVGParsingError parseError = NoError;
property->setBaseValueAsString(value, parseError);
reportAttributeParsingError(parseError, name, value);
-
return;
}
@@ -747,13 +744,13 @@ void SVGElement::addToPropertyMap(PassRefPtrWillBeRawPtr<SVGAnimatedPropertyBase
m_attributeToPropertyMap.set(attributeName, property.release());
}
-PassRefPtrWillBeRawPtr<SVGAnimatedPropertyBase> SVGElement::propertyFromAttribute(const QualifiedName& attributeName)
+SVGAnimatedPropertyBase* SVGElement::propertyFromAttribute(const QualifiedName& attributeName) const
{
- AttributeToPropertyMap::iterator it = m_attributeToPropertyMap.find<SVGAttributeHashTranslator>(attributeName);
+ AttributeToPropertyMap::const_iterator it = m_attributeToPropertyMap.find<SVGAttributeHashTranslator>(attributeName);
if (it == m_attributeToPropertyMap.end())
return nullptr;
- return it->value;
+ return it->value.get();
}
bool SVGElement::isAnimatableCSSProperty(const QualifiedName& attrName)
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGElement.h ('k') | third_party/WebKit/Source/core/svg/SVGEllipseElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698