Index: third_party/WebKit/Source/core/animation/PropertyInterpolationTypesMapping.cpp |
diff --git a/third_party/WebKit/Source/core/animation/PropertyInterpolationTypesMapping.cpp b/third_party/WebKit/Source/core/animation/PropertyInterpolationTypesMapping.cpp |
index 7071a27c563be8ebc8d0934a88480b15dcf13335..2e830b0c6d4394ba5c2eea9f70e6b8cbeee12a52 100644 |
--- a/third_party/WebKit/Source/core/animation/PropertyInterpolationTypesMapping.cpp |
+++ b/third_party/WebKit/Source/core/animation/PropertyInterpolationTypesMapping.cpp |
@@ -48,20 +48,18 @@ |
#include "core/animation/SVGRectInterpolationType.h" |
#include "core/animation/SVGTransformListInterpolationType.h" |
#include "core/animation/SVGValueInterpolationType.h" |
-#include "wtf/PtrUtil.h" |
-#include <memory> |
namespace blink { |
const InterpolationTypes& PropertyInterpolationTypesMapping::get(const PropertyHandle& property) |
{ |
- using ApplicableTypesMap = HashMap<PropertyHandle, std::unique_ptr<const InterpolationTypes>>; |
+ using ApplicableTypesMap = HashMap<PropertyHandle, OwnPtr<const InterpolationTypes>>; |
DEFINE_STATIC_LOCAL(ApplicableTypesMap, applicableTypesMap, ()); |
auto entry = applicableTypesMap.find(property); |
if (entry != applicableTypesMap.end()) |
return *entry->value.get(); |
- std::unique_ptr<InterpolationTypes> applicableTypes = wrapUnique(new InterpolationTypes()); |
+ OwnPtr<InterpolationTypes> applicableTypes = adoptPtr(new InterpolationTypes()); |
if (property.isCSSProperty() || property.isPresentationAttribute()) { |
CSSPropertyID cssProperty = property.isCSSProperty() ? property.cssProperty() : property.presentationAttribute(); |
@@ -117,7 +115,7 @@ const InterpolationTypes& PropertyInterpolationTypesMapping::get(const PropertyH |
case CSSPropertyWordSpacing: |
case CSSPropertyX: |
case CSSPropertyY: |
- applicableTypes->append(wrapUnique(new CSSLengthInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSLengthInterpolationType(cssProperty))); |
break; |
case CSSPropertyFlexGrow: |
case CSSPropertyFlexShrink: |
@@ -133,11 +131,11 @@ const InterpolationTypes& PropertyInterpolationTypesMapping::get(const PropertyH |
case CSSPropertyColumnCount: |
case CSSPropertyWidows: |
case CSSPropertyZIndex: |
- applicableTypes->append(wrapUnique(new CSSNumberInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSNumberInterpolationType(cssProperty))); |
break; |
case CSSPropertyLineHeight: |
- applicableTypes->append(wrapUnique(new CSSLengthInterpolationType(cssProperty))); |
- applicableTypes->append(wrapUnique(new CSSNumberInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSLengthInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSNumberInterpolationType(cssProperty))); |
break; |
case CSSPropertyBackgroundColor: |
case CSSPropertyBorderBottomColor: |
@@ -152,118 +150,118 @@ const InterpolationTypes& PropertyInterpolationTypesMapping::get(const PropertyH |
case CSSPropertyTextDecorationColor: |
case CSSPropertyColumnRuleColor: |
case CSSPropertyWebkitTextStrokeColor: |
- applicableTypes->append(wrapUnique(new CSSColorInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSColorInterpolationType(cssProperty))); |
break; |
case CSSPropertyFill: |
case CSSPropertyStroke: |
- applicableTypes->append(wrapUnique(new CSSPaintInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSPaintInterpolationType(cssProperty))); |
break; |
case CSSPropertyD: |
- applicableTypes->append(wrapUnique(new CSSPathInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSPathInterpolationType(cssProperty))); |
break; |
case CSSPropertyBoxShadow: |
case CSSPropertyTextShadow: |
- applicableTypes->append(wrapUnique(new CSSShadowListInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSShadowListInterpolationType(cssProperty))); |
break; |
case CSSPropertyBorderImageSource: |
case CSSPropertyListStyleImage: |
case CSSPropertyWebkitMaskBoxImageSource: |
- applicableTypes->append(wrapUnique(new CSSImageInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSImageInterpolationType(cssProperty))); |
break; |
case CSSPropertyBackgroundImage: |
case CSSPropertyWebkitMaskImage: |
- applicableTypes->append(wrapUnique(new CSSImageListInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSImageListInterpolationType(cssProperty))); |
break; |
case CSSPropertyStrokeDasharray: |
- applicableTypes->append(wrapUnique(new CSSLengthListInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSLengthListInterpolationType(cssProperty))); |
break; |
case CSSPropertyFontWeight: |
- applicableTypes->append(wrapUnique(new CSSFontWeightInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSFontWeightInterpolationType(cssProperty))); |
break; |
case CSSPropertyVisibility: |
- applicableTypes->append(wrapUnique(new CSSVisibilityInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSVisibilityInterpolationType(cssProperty))); |
break; |
case CSSPropertyClip: |
- applicableTypes->append(wrapUnique(new CSSClipInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSClipInterpolationType(cssProperty))); |
break; |
case CSSPropertyMotionRotation: |
- applicableTypes->append(wrapUnique(new CSSMotionRotationInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSMotionRotationInterpolationType(cssProperty))); |
break; |
case CSSPropertyBackgroundPositionX: |
case CSSPropertyBackgroundPositionY: |
case CSSPropertyWebkitMaskPositionX: |
case CSSPropertyWebkitMaskPositionY: |
- applicableTypes->append(wrapUnique(new CSSPositionAxisListInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSPositionAxisListInterpolationType(cssProperty))); |
break; |
case CSSPropertyPerspectiveOrigin: |
case CSSPropertyObjectPosition: |
- applicableTypes->append(wrapUnique(new CSSPositionInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSPositionInterpolationType(cssProperty))); |
break; |
case CSSPropertyBorderBottomLeftRadius: |
case CSSPropertyBorderBottomRightRadius: |
case CSSPropertyBorderTopLeftRadius: |
case CSSPropertyBorderTopRightRadius: |
- applicableTypes->append(wrapUnique(new CSSLengthPairInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSLengthPairInterpolationType(cssProperty))); |
break; |
case CSSPropertyTranslate: |
- applicableTypes->append(wrapUnique(new CSSTranslateInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSTranslateInterpolationType(cssProperty))); |
break; |
case CSSPropertyTransformOrigin: |
- applicableTypes->append(wrapUnique(new CSSTransformOriginInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSTransformOriginInterpolationType(cssProperty))); |
break; |
case CSSPropertyBackgroundSize: |
case CSSPropertyWebkitMaskSize: |
- applicableTypes->append(wrapUnique(new CSSSizeListInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSSizeListInterpolationType(cssProperty))); |
break; |
case CSSPropertyBorderImageOutset: |
case CSSPropertyBorderImageWidth: |
case CSSPropertyWebkitMaskBoxImageOutset: |
case CSSPropertyWebkitMaskBoxImageWidth: |
- applicableTypes->append(wrapUnique(new CSSBorderImageLengthBoxInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSBorderImageLengthBoxInterpolationType(cssProperty))); |
break; |
case CSSPropertyScale: |
- applicableTypes->append(wrapUnique(new CSSScaleInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSScaleInterpolationType(cssProperty))); |
break; |
case CSSPropertyFontSize: |
- applicableTypes->append(wrapUnique(new CSSFontSizeInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSFontSizeInterpolationType(cssProperty))); |
break; |
case CSSPropertyTextIndent: |
- applicableTypes->append(wrapUnique(new CSSTextIndentInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSTextIndentInterpolationType(cssProperty))); |
break; |
case CSSPropertyBorderImageSlice: |
case CSSPropertyWebkitMaskBoxImageSlice: |
- applicableTypes->append(wrapUnique(new CSSImageSliceInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSImageSliceInterpolationType(cssProperty))); |
break; |
case CSSPropertyWebkitClipPath: |
case CSSPropertyShapeOutside: |
- applicableTypes->append(wrapUnique(new CSSBasicShapeInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSBasicShapeInterpolationType(cssProperty))); |
break; |
case CSSPropertyRotate: |
- applicableTypes->append(wrapUnique(new CSSRotateInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSRotateInterpolationType(cssProperty))); |
break; |
case CSSPropertyBackdropFilter: |
case CSSPropertyWebkitFilter: |
- applicableTypes->append(wrapUnique(new CSSFilterListInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSFilterListInterpolationType(cssProperty))); |
break; |
case CSSPropertyTransform: |
- applicableTypes->append(wrapUnique(new CSSTransformInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSTransformInterpolationType(cssProperty))); |
break; |
default: |
ASSERT(!CSSPropertyMetadata::isInterpolableProperty(cssProperty)); |
} |
- applicableTypes->append(wrapUnique(new CSSValueInterpolationType(cssProperty))); |
+ applicableTypes->append(adoptPtr(new CSSValueInterpolationType(cssProperty))); |
} else { |
const QualifiedName& attribute = property.svgAttribute(); |
if (attribute == SVGNames::orientAttr) { |
- applicableTypes->append(wrapUnique(new SVGAngleInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGAngleInterpolationType(attribute))); |
} else if (attribute == SVGNames::numOctavesAttr |
|| attribute == SVGNames::targetXAttr |
|| attribute == SVGNames::targetYAttr) { |
- applicableTypes->append(wrapUnique(new SVGIntegerInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGIntegerInterpolationType(attribute))); |
} else if (attribute == SVGNames::orderAttr) { |
- applicableTypes->append(wrapUnique(new SVGIntegerOptionalIntegerInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGIntegerOptionalIntegerInterpolationType(attribute))); |
} else if (attribute == SVGNames::cxAttr |
|| attribute == SVGNames::cyAttr |
|| attribute == SVGNames::fxAttr |
@@ -283,15 +281,15 @@ const InterpolationTypes& PropertyInterpolationTypesMapping::get(const PropertyH |
|| attribute == SVGNames::x2Attr |
|| attribute == SVGNames::y1Attr |
|| attribute == SVGNames::y2Attr) { |
- applicableTypes->append(wrapUnique(new SVGLengthInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGLengthInterpolationType(attribute))); |
} else if (attribute == SVGNames::dxAttr |
|| attribute == SVGNames::dyAttr) { |
- applicableTypes->append(wrapUnique(new SVGNumberInterpolationType(attribute))); |
- applicableTypes->append(wrapUnique(new SVGLengthListInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGNumberInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGLengthListInterpolationType(attribute))); |
} else if (attribute == SVGNames::xAttr |
|| attribute == SVGNames::yAttr) { |
- applicableTypes->append(wrapUnique(new SVGLengthInterpolationType(attribute))); |
- applicableTypes->append(wrapUnique(new SVGLengthListInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGLengthInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGLengthListInterpolationType(attribute))); |
} else if (attribute == SVGNames::amplitudeAttr |
|| attribute == SVGNames::azimuthAttr |
|| attribute == SVGNames::biasAttr |
@@ -317,27 +315,27 @@ const InterpolationTypes& PropertyInterpolationTypesMapping::get(const PropertyH |
|| attribute == SVGNames::specularExponentAttr |
|| attribute == SVGNames::surfaceScaleAttr |
|| attribute == SVGNames::zAttr) { |
- applicableTypes->append(wrapUnique(new SVGNumberInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGNumberInterpolationType(attribute))); |
} else if (attribute == SVGNames::kernelMatrixAttr |
|| attribute == SVGNames::rotateAttr |
|| attribute == SVGNames::tableValuesAttr |
|| attribute == SVGNames::valuesAttr) { |
- applicableTypes->append(wrapUnique(new SVGNumberListInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGNumberListInterpolationType(attribute))); |
} else if (attribute == SVGNames::baseFrequencyAttr |
|| attribute == SVGNames::kernelUnitLengthAttr |
|| attribute == SVGNames::radiusAttr |
|| attribute == SVGNames::stdDeviationAttr) { |
- applicableTypes->append(wrapUnique(new SVGNumberOptionalNumberInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGNumberOptionalNumberInterpolationType(attribute))); |
} else if (attribute == SVGNames::dAttr) { |
- applicableTypes->append(wrapUnique(new SVGPathInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGPathInterpolationType(attribute))); |
} else if (attribute == SVGNames::pointsAttr) { |
- applicableTypes->append(wrapUnique(new SVGPointListInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGPointListInterpolationType(attribute))); |
} else if (attribute == SVGNames::viewBoxAttr) { |
- applicableTypes->append(wrapUnique(new SVGRectInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGRectInterpolationType(attribute))); |
} else if (attribute == SVGNames::gradientTransformAttr |
|| attribute == SVGNames::patternTransformAttr |
|| attribute == SVGNames::transformAttr) { |
- applicableTypes->append(wrapUnique(new SVGTransformListInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGTransformListInterpolationType(attribute))); |
} else if (attribute == HTMLNames::classAttr |
|| attribute == SVGNames::clipPathUnitsAttr |
|| attribute == SVGNames::edgeModeAttr |
@@ -371,7 +369,7 @@ const InterpolationTypes& PropertyInterpolationTypesMapping::get(const PropertyH |
ASSERT_NOT_REACHED(); |
} |
- applicableTypes->append(wrapUnique(new SVGValueInterpolationType(attribute))); |
+ applicableTypes->append(adoptPtr(new SVGValueInterpolationType(attribute))); |
} |
auto addResult = applicableTypesMap.add(property, std::move(applicableTypes)); |