+2013-11-19 Sergio Correia <sergio.correia@openbossa.org>
+
+ [SVG] Convert OwnPtr/PassOwnPtr to std::unique_ptr
+ https://bugs.webkit.org/show_bug.cgi?id=124382
+
+ Reviewed by Darin Adler.
+
+ The files modified are mostly under WebCore/svg/; in a few cases, some
+ "external" files needed changes as well.
+
+ No new tests, covered by existing ones.
+
+ * css/CSSFontFaceSource.cpp:
+ * loader/cache/CachedImage.cpp:
+ * loader/cache/CachedImage.h:
+ * platform/graphics/SimpleFontData.cpp:
+ * platform/graphics/SimpleFontData.h:
+ * rendering/svg/RenderSVGResourceContainer.cpp:
+ * svg/SVGAnimateElement.cpp:
+ * svg/SVGAnimateElement.h:
+ * svg/SVGAnimatedAngle.cpp:
+ * svg/SVGAnimatedAngle.h:
+ * svg/SVGAnimatedBoolean.cpp:
+ * svg/SVGAnimatedBoolean.h:
+ * svg/SVGAnimatedColor.cpp:
+ * svg/SVGAnimatedColor.h:
+ * svg/SVGAnimatedEnumeration.cpp:
+ * svg/SVGAnimatedEnumeration.h:
+ * svg/SVGAnimatedInteger.cpp:
+ * svg/SVGAnimatedInteger.h:
+ * svg/SVGAnimatedIntegerOptionalInteger.cpp:
+ * svg/SVGAnimatedIntegerOptionalInteger.h:
+ * svg/SVGAnimatedLength.cpp:
+ * svg/SVGAnimatedLength.h:
+ * svg/SVGAnimatedLengthList.cpp:
+ * svg/SVGAnimatedLengthList.h:
+ * svg/SVGAnimatedNumber.cpp:
+ * svg/SVGAnimatedNumber.h:
+ * svg/SVGAnimatedNumberList.cpp:
+ * svg/SVGAnimatedNumberList.h:
+ * svg/SVGAnimatedNumberOptionalNumber.cpp:
+ * svg/SVGAnimatedNumberOptionalNumber.h:
+ * svg/SVGAnimatedPath.cpp:
+ * svg/SVGAnimatedPath.h:
+ * svg/SVGAnimatedPointList.cpp:
+ * svg/SVGAnimatedPointList.h:
+ * svg/SVGAnimatedPreserveAspectRatio.cpp:
+ * svg/SVGAnimatedPreserveAspectRatio.h:
+ * svg/SVGAnimatedRect.cpp:
+ * svg/SVGAnimatedRect.h:
+ * svg/SVGAnimatedString.cpp:
+ * svg/SVGAnimatedString.h:
+ * svg/SVGAnimatedTransformList.cpp:
+ * svg/SVGAnimatedTransformList.h:
+ * svg/SVGAnimatedType.cpp:
+ * svg/SVGAnimatedType.h:
+ * svg/SVGAnimatedTypeAnimator.cpp:
+ * svg/SVGAnimatedTypeAnimator.h:
+ * svg/SVGAnimatorFactory.h:
+ * svg/SVGDocumentExtensions.cpp:
+ * svg/SVGDocumentExtensions.h:
+ * svg/SVGFontData.h:
+ * svg/SVGFontElement.cpp:
+ * svg/SVGFontElement.h:
+ * svg/SVGGraphicsElement.cpp:
+ * svg/SVGGraphicsElement.h:
+ * svg/SVGPathByteStreamSource.h:
+ * svg/SVGPathParser.h:
+ * svg/SVGPathSegListSource.h:
+ * svg/SVGPathStringSource.h:
+ * svg/SVGPathUtilities.cpp:
+ * svg/SVGPathUtilities.h:
+ * svg/animation/SMILTimeContainer.cpp:
+ * svg/animation/SMILTimeContainer.h:
+ * svg/graphics/SVGImage.cpp:
+ * svg/graphics/SVGImage.h:
+ * svg/graphics/SVGImageCache.h:
+ * svg/properties/SVGAttributeToPropertyMap.cpp:
+ * svg/properties/SVGAttributeToPropertyMap.h:
+
2013-11-19 Zoltan Horvath <zoltan@webkit.org>
Add LineInlineHeaders.h to WebCore.xcodeproj
m_svgFontFaceElement = firstFontFace;
}
- fontData = SimpleFontData::create(SVGFontData::create(firstFontFace), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
+ fontData = SimpleFontData::create(std::make_unique<SVGFontData>(firstFontFace), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
}
} else
#endif
#if ENABLE(SVG_FONTS)
// In-Document SVG Fonts
if (m_svgFontFaceElement)
- fontData = SimpleFontData::create(SVGFontData::create(m_svgFontFaceElement.get()), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
+ fontData = SimpleFontData::create(std::make_unique<SVGFontData>(m_svgFontFaceElement.get()), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
#endif
}
} else {
#if ENABLE(SVG)
else if (m_response.mimeType() == "image/svg+xml") {
RefPtr<SVGImage> svgImage = SVGImage::create(this);
- m_svgImageCache = SVGImageCache::create(svgImage.get());
+ m_svgImageCache = std::make_unique<SVGImageCache>(svgImage.get());
m_image = svgImage.release();
}
#endif
RefPtr<Image> m_image;
#if ENABLE(SVG)
- OwnPtr<SVGImageCache> m_svgImageCache;
+ std::unique_ptr<SVGImageCache> m_svgImageCache;
#endif
bool m_shouldPaintBrokenImage;
};
#endif
}
-SimpleFontData::SimpleFontData(PassOwnPtr<AdditionalFontData> fontData, float fontSize, bool syntheticBold, bool syntheticItalic)
+SimpleFontData::SimpleFontData(std::unique_ptr<AdditionalFontData> fontData, float fontSize, bool syntheticBold, bool syntheticItalic)
: m_platformData(FontPlatformData(fontSize, syntheticBold, syntheticItalic))
- , m_fontData(fontData)
+ , m_fontData(std::move(fontData))
, m_treatAsFixedPitch(false)
, m_isCustomFont(true)
, m_isLoading(false)
}
// Used to create SVG Fonts.
- static PassRefPtr<SimpleFontData> create(PassOwnPtr<AdditionalFontData> fontData, float fontSize, bool syntheticBold, bool syntheticItalic)
+ static PassRefPtr<SimpleFontData> create(std::unique_ptr<AdditionalFontData> fontData, float fontSize, bool syntheticBold, bool syntheticItalic)
{
- return adoptRef(new SimpleFontData(fontData, fontSize, syntheticBold, syntheticItalic));
+ return adoptRef(new SimpleFontData(std::move(fontData), fontSize, syntheticBold, syntheticItalic));
}
virtual ~SimpleFontData();
FontMetrics& fontMetrics() { return m_fontMetrics; }
const FontMetrics& fontMetrics() const { return m_fontMetrics; }
float sizePerUnit() const { return platformData().size() / (fontMetrics().unitsPerEm() ? fontMetrics().unitsPerEm() : 1); }
-
+
float maxCharWidth() const { return m_maxCharWidth; }
void setMaxCharWidth(float maxCharWidth) { m_maxCharWidth = maxCharWidth; }
Pitch pitch() const { return m_treatAsFixedPitch ? FixedPitch : VariablePitch; }
AdditionalFontData* fontData() const { return m_fontData.get(); }
- bool isSVGFont() const { return m_fontData; }
+ bool isSVGFont() const { return m_fontData != nullptr; }
virtual bool isCustomFont() const OVERRIDE { return m_isCustomFont; }
virtual bool isLoading() const OVERRIDE { return m_isLoading; }
private:
SimpleFontData(const FontPlatformData&, bool isCustomFont = false, bool isLoading = false, bool isTextOrientationFallback = false);
- SimpleFontData(PassOwnPtr<AdditionalFontData> , float fontSize, bool syntheticBold, bool syntheticItalic);
+ SimpleFontData(std::unique_ptr<AdditionalFontData>, float fontSize, bool syntheticBold, bool syntheticItalic);
void platformInit();
void platformGlyphInit();
void platformCharWidthInit();
void platformDestroy();
-
+
void initCharWidths();
PassRefPtr<SimpleFontData> createScaledFontData(const FontDescription&, float scaleFactor) const;
FontMetrics m_fontMetrics;
float m_maxCharWidth;
float m_avgCharWidth;
-
+
FontPlatformData m_platformData;
- OwnPtr<AdditionalFontData> m_fontData;
+ std::unique_ptr<AdditionalFontData> m_fontData;
mutable OwnPtr<GlyphMetricsMap<FloatRect>> m_glyphToBoundsMap;
mutable GlyphMetricsMap<float> m_glyphToWidthMap;
bool m_treatAsFixedPitch;
bool m_isCustomFont; // Whether or not we are custom font loaded via @font-face
bool m_isLoading; // Whether or not this custom font is still in the act of loading.
-
+
bool m_isTextOrientationFallback;
bool m_isBrokenIdeographFallback;
#if ENABLE(OPENTYPE_VERTICAL)
RefPtr<OpenTypeVerticalData> m_verticalData;
#endif
bool m_hasVerticalGlyphs;
-
+
Glyph m_spaceGlyph;
float m_spaceWidth;
Glyph m_zeroGlyph;
#if PLATFORM(MAC)
mutable RetainPtr<CFMutableDictionaryRef> compositeFontReferences;
#endif
-
+
private:
DerivedFontData(bool custom)
: forCustomFont(custom)
return;
}
- OwnPtr<SVGDocumentExtensions::SVGPendingElements> clients = extensions.removePendingResource(m_id);
+ std::unique_ptr<SVGDocumentExtensions::SVGPendingElements> clients = extensions.removePendingResource(m_id);
// Cache us with the new id.
extensions.addResource(m_id, this);
return;
if (!targetElement) {
- m_animatedType.clear();
+ m_animatedType = nullptr;
return;
}
if (m_animatedProperties.isEmpty()) {
// CSS properties animation code-path.
removeCSSPropertyFromTargetAndInstances(targetElement, attributeName());
- m_animatedType.clear();
+ m_animatedType = nullptr;
return;
}
}
m_animatedProperties.clear();
- m_animatedType.clear();
+ m_animatedType = nullptr;
}
void SVGAnimateElement::applyResultsToTarget()
void SVGAnimateElement::resetAnimatedPropertyType()
{
ASSERT(!m_animatedType);
- m_fromType.clear();
- m_toType.clear();
- m_toAtEndOfDurationType.clear();
- m_animator.clear();
+ m_fromType = nullptr;
+ m_toType = nullptr;
+ m_toAtEndOfDurationType = nullptr;
+ m_animator = nullptr;
m_animatedPropertyType = targetElement() ? determineAnimatedPropertyType(targetElement()) : AnimatedString;
}
#include "SVGAnimatedTypeAnimator.h"
#include "SVGAnimationElement.h"
#include "SVGNames.h"
-#include <wtf/OwnPtr.h>
namespace WebCore {
-
+
class SVGAnimatedProperty;
class SVGAnimateElement : public SVGAnimationElement {
virtual ~SVGAnimateElement();
AnimatedPropertyType determineAnimatedPropertyType(SVGElement*) const;
-
+
protected:
SVGAnimateElement(const QualifiedName&, Document&);
virtual bool hasValidAttributeType() OVERRIDE;
- OwnPtr<SVGAnimatedType> m_fromType;
- OwnPtr<SVGAnimatedType> m_toType;
- OwnPtr<SVGAnimatedType> m_toAtEndOfDurationType;
- OwnPtr<SVGAnimatedType> m_animatedType;
+ std::unique_ptr<SVGAnimatedType> m_fromType;
+ std::unique_ptr<SVGAnimatedType> m_toType;
+ std::unique_ptr<SVGAnimatedType> m_toAtEndOfDurationType;
+ std::unique_ptr<SVGAnimatedType> m_animatedType;
SVGElementAnimatedPropertyList m_animatedProperties;
- OwnPtr<SVGAnimatedTypeAnimator> m_animator;
+ std::unique_ptr<SVGAnimatedTypeAnimator> m_animator;
};
void isSVGAnimateElement(const SVGAnimateElement&); // Catch unnecessary runtime check of type known at compile time.
{
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedAngleAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedAngleAnimator::constructFromString(const String& string)
{
- OwnPtr<SVGAnimatedType> animatedType = SVGAnimatedType::createAngleAndEnumeration(new pair<SVGAngle, unsigned>);
+ auto animatedType = SVGAnimatedType::createAngleAndEnumeration(new pair<SVGAngle, unsigned>);
pair<SVGAngle, unsigned>& animatedPair = animatedType->angleAndEnumeration();
SVGAngle angle;
if (orientType == SVGMarkerOrientAngle)
animatedPair.first = angle;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedAngleAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedAngleAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
return SVGAnimatedType::createAngleAndEnumeration(constructFromBaseValues<SVGAnimatedAngle, SVGAnimatedEnumeration>(animatedTypes));
}
SVGAnimatedAngleAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedAngleAnimator() { }
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&);
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*);
virtual void animValWillChange(const SVGElementAnimatedPropertyList&);
{
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedBooleanAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedBooleanAnimator::constructFromString(const String& string)
{
- OwnPtr<SVGAnimatedType> animtedType = SVGAnimatedType::createBoolean(new bool);
- animtedType->boolean() = (string == "true"); // wat?
- return animtedType.release();
+ auto animatedType = SVGAnimatedType::createBoolean(new bool);
+ animatedType->boolean() = (string == "true"); // wat?
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedBooleanAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedBooleanAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
return SVGAnimatedType::createBoolean(constructFromBaseValue<SVGAnimatedBoolean>(animatedTypes));
}
public:
SVGAnimatedBooleanAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedBooleanAnimator() { }
-
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&) OVERRIDE;
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) OVERRIDE;
+
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&) OVERRIDE;
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) OVERRIDE;
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) OVERRIDE;
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*) OVERRIDE;
virtual void animValWillChange(const SVGElementAnimatedPropertyList&) OVERRIDE;
{
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedColorAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedColorAnimator::constructFromString(const String& string)
{
- OwnPtr<SVGAnimatedType> animtedType = SVGAnimatedType::createColor(new Color);
- animtedType->color() = string.isEmpty() ? Color() : SVGColor::colorFromRGBColorString(string);
- return animtedType.release();
+ auto animatedType = SVGAnimatedType::createColor(new Color);
+ animatedType->color() = string.isEmpty() ? Color() : SVGColor::colorFromRGBColorString(string);
+ return animatedType;
}
void SVGAnimatedColorAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to)
#include "SVGAnimatedTypeAnimator.h"
namespace WebCore {
-
+
class SVGAnimationElement;
class SVGAnimatedColorAnimator : public SVGAnimatedTypeAnimator {
public:
SVGAnimatedColorAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedColorAnimator() { }
-
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) { return PassOwnPtr<SVGAnimatedType>(); }
+
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&);
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) { return nullptr; }
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) { }
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*) { }
virtual void animValWillChange(const SVGElementAnimatedPropertyList&) { }
{
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedEnumerationAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedEnumerationAnimator::constructFromString(const String& string)
{
ASSERT(m_animationElement);
- OwnPtr<SVGAnimatedType> animatedType = SVGAnimatedType::createEnumeration(new unsigned);
+ auto animatedType = SVGAnimatedType::createEnumeration(new unsigned);
animatedType->enumeration() = enumerationValueForTargetAttribute(m_animationElement->targetElement(), m_animationElement->attributeName(), string);
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedEnumerationAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedEnumerationAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
return SVGAnimatedType::createEnumeration(constructFromBaseValue<SVGAnimatedEnumeration>(animatedTypes));
}
SVGAnimatedEnumerationAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedEnumerationAnimator() { }
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&);
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*);
virtual void animValWillChange(const SVGElementAnimatedPropertyList&);
{
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedIntegerAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedIntegerAnimator::constructFromString(const String& string)
{
- OwnPtr<SVGAnimatedType> animtedType = SVGAnimatedType::createInteger(new int);
- animtedType->integer() = string.toIntStrict();
- return animtedType.release();
+ auto animatedType = SVGAnimatedType::createInteger(new int);
+ animatedType->integer() = string.toIntStrict();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedIntegerAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedIntegerAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
return SVGAnimatedType::createInteger(constructFromBaseValue<SVGAnimatedInteger>(animatedTypes));
}
int to = toString.toIntStrict();
return abs(to - from);
}
-
+
}
#endif // ENABLE(SVG)
static void calculateAnimatedInteger(SVGAnimationElement*, float percentage, unsigned repeatCount, int fromInteger, int toInteger, int toAtEndOfDurationInteger, int& animatedInteger);
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&);
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*);
virtual void animValWillChange(const SVGElementAnimatedPropertyList&);
{
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedIntegerOptionalIntegerAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedIntegerOptionalIntegerAnimator::constructFromString(const String& string)
{
- OwnPtr<SVGAnimatedType> animtedType = SVGAnimatedType::createIntegerOptionalInteger(new pair<int, int>);
- pair<int, int>& animatedInteger = animtedType->integerOptionalInteger();
+ auto animatedType = SVGAnimatedType::createIntegerOptionalInteger(new pair<int, int>);
+ pair<int, int>& animatedInteger = animatedType->integerOptionalInteger();
float firstNumber = 0;
float secondNumber = 0;
if (!parseNumberOptionalNumber(string, firstNumber, secondNumber)) {
animatedInteger.first = static_cast<int>(roundf(firstNumber));
animatedInteger.second = static_cast<int>(roundf(secondNumber));
}
- return animtedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedIntegerOptionalIntegerAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedIntegerOptionalIntegerAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
return SVGAnimatedType::createIntegerOptionalInteger(constructFromBaseValues<SVGAnimatedInteger, SVGAnimatedInteger>(animatedTypes));
}
public:
SVGAnimatedIntegerOptionalIntegerAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedIntegerOptionalIntegerAnimator() { }
-
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
+
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&);
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*);
virtual void animValWillChange(const SVGElementAnimatedPropertyList&);
return sharedLength;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedLengthAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedLengthAnimator::constructFromString(const String& string)
{
return SVGAnimatedType::createLength(new SVGLength(m_lengthMode, string));
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedLengthAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedLengthAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
return SVGAnimatedType::createLength(constructFromBaseValue<SVGAnimatedLength>(animatedTypes));
}
SVGAnimatedLengthAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedLengthAnimator() { }
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&);
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*);
virtual void animValWillChange(const SVGElementAnimatedPropertyList&);
{
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedLengthListAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedLengthListAnimator::constructFromString(const String& string)
{
- OwnPtr<SVGAnimatedType> animateType = SVGAnimatedType::createLengthList(new SVGLengthList);
- animateType->lengthList().parse(string, m_lengthMode);
- return animateType.release();
+ auto animatedType = SVGAnimatedType::createLengthList(new SVGLengthList);
+ animatedType->lengthList().parse(string, m_lengthMode);
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedLengthListAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedLengthListAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
return SVGAnimatedType::createLengthList(constructFromBaseValue<SVGAnimatedLengthList>(animatedTypes));
}
public:
SVGAnimatedLengthListAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedLengthListAnimator() { }
-
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
+
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&);
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*);
virtual void animValWillChange(const SVGElementAnimatedPropertyList&);
virtual void addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*);
virtual void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*);
virtual float calculateDistance(const String& fromString, const String& toString);
-
+
private:
SVGLengthMode m_lengthMode;
};
{
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedNumberAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberAnimator::constructFromString(const String& string)
{
- OwnPtr<SVGAnimatedType> animtedType = SVGAnimatedType::createNumber(new float);
- float& animatedNumber = animtedType->number();
+ auto animatedType = SVGAnimatedType::createNumber(new float);
+ float& animatedNumber = animatedType->number();
if (!parseNumberFromString(string, animatedNumber))
animatedNumber = 0;
- return animtedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedNumberAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
return SVGAnimatedType::createNumber(constructFromBaseValue<SVGAnimatedNumber>(animatedTypes));
}
SVGAnimatedNumberAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedNumberAnimator() { }
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&);
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*);
virtual void animValWillChange(const SVGElementAnimatedPropertyList&);
{
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedNumberListAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberListAnimator::constructFromString(const String& string)
{
- OwnPtr<SVGAnimatedType> animtedType = SVGAnimatedType::createNumberList(new SVGNumberList);
- animtedType->numberList().parse(string);
- return animtedType.release();
+ auto animatedType = SVGAnimatedType::createNumberList(new SVGNumberList);
+ animatedType->numberList().parse(string);
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedNumberListAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberListAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
return SVGAnimatedType::createNumberList(constructFromBaseValue<SVGAnimatedNumberList>(animatedTypes));
}
public:
SVGAnimatedNumberListAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedNumberListAnimator() { }
-
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
+
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&);
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*);
virtual void animValWillChange(const SVGElementAnimatedPropertyList&);
{
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedNumberOptionalNumberAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberOptionalNumberAnimator::constructFromString(const String& string)
{
- OwnPtr<SVGAnimatedType> animtedType = SVGAnimatedType::createNumberOptionalNumber(new pair<float, float>);
- pair<float, float>& animatedNumber = animtedType->numberOptionalNumber();
+ auto animatedType = SVGAnimatedType::createNumberOptionalNumber(new pair<float, float>);
+ pair<float, float>& animatedNumber = animatedType->numberOptionalNumber();
if (!parseNumberOptionalNumber(string, animatedNumber.first, animatedNumber.second)) {
animatedNumber.first = 0;
animatedNumber.second = 0;
}
- return animtedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedNumberOptionalNumberAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberOptionalNumberAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
return SVGAnimatedType::createNumberOptionalNumber(constructFromBaseValues<SVGAnimatedNumber, SVGAnimatedNumber>(animatedTypes));
}
public:
SVGAnimatedNumberOptionalNumberAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedNumberOptionalNumberAnimator() { }
-
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
+
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&);
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*);
virtual void animValWillChange(const SVGElementAnimatedPropertyList&);
{
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedPathAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedPathAnimator::constructFromString(const String& string)
{
auto byteStream = std::make_unique<SVGPathByteStream>();
buildSVGPathByteStreamFromString(string, byteStream.get(), UnalteredParsing);
return SVGAnimatedType::createPath(std::move(byteStream));
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedPathAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedPathAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
ASSERT(animatedTypes.size() >= 1);
SVGAnimatedPathSegListPropertyTearOff* property = castAnimatedPropertyToActualType<SVGAnimatedPathSegListPropertyTearOff>(animatedTypes[0].properties[0].get());
if (m_animationElement->isAccumulated() && repeatCount)
addToSVGPathByteStream(animatedPath, toAtEndOfDurationPath, repeatCount);
}
-
+
float SVGAnimatedPathAnimator::calculateDistance(const String&, const String&)
{
// FIXME: Support paced animations.
SVGAnimatedPathAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedPathAnimator() { }
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&);
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*);
virtual void animValWillChange(const SVGElementAnimatedPropertyList&);
{
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedPointListAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedPointListAnimator::constructFromString(const String& string)
{
- OwnPtr<SVGAnimatedType> animtedType = SVGAnimatedType::createPointList(new SVGPointList);
- pointsListFromSVGData(animtedType->pointList(), string);
- return animtedType.release();
+ auto animatedType = SVGAnimatedType::createPointList(new SVGPointList);
+ pointsListFromSVGData(animatedType->pointList(), string);
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedPointListAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedPointListAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
return SVGAnimatedType::createPointList(constructFromBaseValue<SVGAnimatedPointList>(animatedTypes));
}
public:
SVGAnimatedPointListAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedPointListAnimator() { }
-
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
+
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&);
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*);
virtual void animValWillChange(const SVGElementAnimatedPropertyList&);
#include "SVGAnimateElement.h"
namespace WebCore {
-
+
SVGAnimatedPreserveAspectRatioAnimator::SVGAnimatedPreserveAspectRatioAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement)
: SVGAnimatedTypeAnimator(AnimatedPreserveAspectRatio, animationElement, contextElement)
{
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedPreserveAspectRatioAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedPreserveAspectRatioAnimator::constructFromString(const String& string)
{
- OwnPtr<SVGAnimatedType> animatedType = SVGAnimatedType::createPreserveAspectRatio(new SVGPreserveAspectRatio);
+ auto animatedType = SVGAnimatedType::createPreserveAspectRatio(new SVGPreserveAspectRatio);
animatedType->preserveAspectRatio().parse(string);
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedPreserveAspectRatioAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedPreserveAspectRatioAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
return SVGAnimatedType::createPreserveAspectRatio(constructFromBaseValue<SVGAnimatedPreserveAspectRatio>(animatedTypes));
}
public:
SVGAnimatedPreserveAspectRatioAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedPreserveAspectRatioAnimator() { }
-
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
+
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&);
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*);
virtual void animValWillChange(const SVGElementAnimatedPropertyList&);
{
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedRectAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedRectAnimator::constructFromString(const String& string)
{
- OwnPtr<SVGAnimatedType> animatedType = SVGAnimatedType::createRect(new FloatRect);
+ auto animatedType = SVGAnimatedType::createRect(new FloatRect);
parseRect(string, animatedType->rect());
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedRectAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedRectAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
return SVGAnimatedType::createRect(constructFromBaseValue<SVGAnimatedRect>(animatedTypes));
}
// FIXME: Distance calculation is not possible for SVGRect right now. We need the distance of for every single value.
return -1;
}
-
+
}
#endif // ENABLE(SVG)
SVGAnimatedRectAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedRectAnimator() { }
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&);
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&);
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*);
virtual void animValWillChange(const SVGElementAnimatedPropertyList&);
{
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedStringAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedStringAnimator::constructFromString(const String& string)
{
- OwnPtr<SVGAnimatedType> animatedType = SVGAnimatedType::createString(new String);
+ auto animatedType = SVGAnimatedType::createString(new String);
animatedType->string() = string;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedStringAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedStringAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
return SVGAnimatedType::createString(constructFromBaseValue<SVGAnimatedString>(animatedTypes));
}
SVGAnimatedStringAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedStringAnimator() { }
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&) OVERRIDE;
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) OVERRIDE;
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&) OVERRIDE;
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) OVERRIDE;
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) OVERRIDE;
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*) OVERRIDE;
virtual void animValWillChange(const SVGElementAnimatedPropertyList&) OVERRIDE;
ASSERT(animationElement->hasTagName(SVGNames::animateTransformTag));
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedTransformListAnimator::constructFromString(const String& string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedTransformListAnimator::constructFromString(const String& string)
{
- OwnPtr<SVGAnimatedType> animatedType = SVGAnimatedType::createTransformList(new SVGTransformList);
+ auto animatedType = SVGAnimatedType::createTransformList(new SVGTransformList);
animatedType->transformList().parse(m_transformTypeString + string + ')');
ASSERT(animatedType->transformList().size() <= 1);
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedTransformListAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedTransformListAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
{
return SVGAnimatedType::createTransformList(constructFromBaseValue<SVGAnimatedTransformList>(animatedTypes));
}
// FIXME: This is not correct in all cases. The spec demands that each component (translate x and y for example)
// is paced separately. To implement this we need to treat each component as individual animation everywhere.
- OwnPtr<SVGAnimatedType> from = constructFromString(fromString);
- OwnPtr<SVGAnimatedType> to = constructFromString(toString);
+ std::unique_ptr<SVGAnimatedType> from = constructFromString(fromString);
+ std::unique_ptr<SVGAnimatedType> to = constructFromString(toString);
SVGTransformList& fromTransformList = from->transformList();
SVGTransformList& toTransformList = to->transformList();
SVGAnimatedTransformListAnimator(SVGAnimationElement*, SVGElement*);
virtual ~SVGAnimatedTransformListAnimator() { }
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&) OVERRIDE;
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) OVERRIDE;
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&) OVERRIDE;
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) OVERRIDE;
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) OVERRIDE;
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*) OVERRIDE;
virtual void animValWillChange(const SVGElementAnimatedPropertyList&) OVERRIDE;
}
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createAngleAndEnumeration(std::pair<SVGAngle, unsigned>* angleAndEnumeration)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createAngleAndEnumeration(std::pair<SVGAngle, unsigned>* angleAndEnumeration)
{
ASSERT(angleAndEnumeration);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedAngle));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedAngle);
animatedType->m_data.angleAndEnumeration = angleAndEnumeration;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createBoolean(bool* boolean)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createBoolean(bool* boolean)
{
ASSERT(boolean);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedBoolean));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedBoolean);
animatedType->m_data.boolean = boolean;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createColor(Color* color)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createColor(Color* color)
{
ASSERT(color);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedColor));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedColor);
animatedType->m_data.color = color;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createEnumeration(unsigned* enumeration)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createEnumeration(unsigned* enumeration)
{
ASSERT(enumeration);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedEnumeration));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedEnumeration);
animatedType->m_data.enumeration = enumeration;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createInteger(int* integer)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createInteger(int* integer)
{
ASSERT(integer);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedInteger));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedInteger);
animatedType->m_data.integer = integer;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createIntegerOptionalInteger(pair<int, int>* integerOptionalInteger)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createIntegerOptionalInteger(pair<int, int>* integerOptionalInteger)
{
ASSERT(integerOptionalInteger);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedIntegerOptionalInteger));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedIntegerOptionalInteger);
animatedType->m_data.integerOptionalInteger = integerOptionalInteger;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createLength(SVGLength* length)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createLength(SVGLength* length)
{
ASSERT(length);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedLength));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedLength);
animatedType->m_data.length = length;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createLengthList(SVGLengthList* lengthList)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createLengthList(SVGLengthList* lengthList)
{
ASSERT(lengthList);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedLengthList));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedLengthList);
animatedType->m_data.lengthList = lengthList;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createNumber(float* number)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createNumber(float* number)
{
ASSERT(number);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedNumber));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedNumber);
animatedType->m_data.number = number;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createNumberList(SVGNumberList* numberList)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createNumberList(SVGNumberList* numberList)
{
ASSERT(numberList);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedNumberList));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedNumberList);
animatedType->m_data.numberList = numberList;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createNumberOptionalNumber(pair<float, float>* numberOptionalNumber)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createNumberOptionalNumber(pair<float, float>* numberOptionalNumber)
{
ASSERT(numberOptionalNumber);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedNumberOptionalNumber));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedNumberOptionalNumber);
animatedType->m_data.numberOptionalNumber = numberOptionalNumber;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createPath(std::unique_ptr<SVGPathByteStream> path)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createPath(std::unique_ptr<SVGPathByteStream> path)
{
ASSERT(path);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedPath));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedPath);
animatedType->m_data.path = path.release();
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createPointList(SVGPointList* pointList)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createPointList(SVGPointList* pointList)
{
ASSERT(pointList);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedPoints));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedPoints);
animatedType->m_data.pointList = pointList;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createPreserveAspectRatio(SVGPreserveAspectRatio* preserveAspectRatio)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createPreserveAspectRatio(SVGPreserveAspectRatio* preserveAspectRatio)
{
ASSERT(preserveAspectRatio);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedPreserveAspectRatio));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedPreserveAspectRatio);
animatedType->m_data.preserveAspectRatio = preserveAspectRatio;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createRect(FloatRect* rect)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createRect(FloatRect* rect)
{
ASSERT(rect);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedRect));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedRect);
animatedType->m_data.rect = rect;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createString(String* string)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createString(String* string)
{
ASSERT(string);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedString));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedString);
animatedType->m_data.string = string;
- return animatedType.release();
+ return animatedType;
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createTransformList(SVGTransformList* transformList)
+std::unique_ptr<SVGAnimatedType> SVGAnimatedType::createTransformList(SVGTransformList* transformList)
{
ASSERT(transformList);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedTransformList));
+ auto animatedType = std::make_unique<SVGAnimatedType>(AnimatedTransformList);
animatedType->m_data.transformList = transformList;
- return animatedType.release();
+ return animatedType;
}
String SVGAnimatedType::valueAsString()
class SVGAnimatedType {
WTF_MAKE_FAST_ALLOCATED;
public:
+ SVGAnimatedType(AnimatedPropertyType);
virtual ~SVGAnimatedType();
- static PassOwnPtr<SVGAnimatedType> createAngleAndEnumeration(std::pair<SVGAngle, unsigned>*);
- static PassOwnPtr<SVGAnimatedType> createBoolean(bool*);
- static PassOwnPtr<SVGAnimatedType> createColor(Color*);
- static PassOwnPtr<SVGAnimatedType> createEnumeration(unsigned*);
- static PassOwnPtr<SVGAnimatedType> createInteger(int*);
- static PassOwnPtr<SVGAnimatedType> createIntegerOptionalInteger(std::pair<int, int>*);
- static PassOwnPtr<SVGAnimatedType> createLength(SVGLength*);
- static PassOwnPtr<SVGAnimatedType> createLengthList(SVGLengthList*);
- static PassOwnPtr<SVGAnimatedType> createNumber(float*);
- static PassOwnPtr<SVGAnimatedType> createNumberList(SVGNumberList*);
- static PassOwnPtr<SVGAnimatedType> createNumberOptionalNumber(std::pair<float, float>*);
- static PassOwnPtr<SVGAnimatedType> createPath(std::unique_ptr<SVGPathByteStream>);
- static PassOwnPtr<SVGAnimatedType> createPointList(SVGPointList*);
- static PassOwnPtr<SVGAnimatedType> createPreserveAspectRatio(SVGPreserveAspectRatio*);
- static PassOwnPtr<SVGAnimatedType> createRect(FloatRect*);
- static PassOwnPtr<SVGAnimatedType> createString(String*);
- static PassOwnPtr<SVGAnimatedType> createTransformList(SVGTransformList*);
+ // FIXME: These functions should all take std::unique_ptr arguments instead of bare pointers.
+ static std::unique_ptr<SVGAnimatedType> createAngleAndEnumeration(std::pair<SVGAngle, unsigned>*);
+ static std::unique_ptr<SVGAnimatedType> createBoolean(bool*);
+ static std::unique_ptr<SVGAnimatedType> createColor(Color*);
+ static std::unique_ptr<SVGAnimatedType> createEnumeration(unsigned*);
+ static std::unique_ptr<SVGAnimatedType> createInteger(int*);
+ static std::unique_ptr<SVGAnimatedType> createIntegerOptionalInteger(std::pair<int, int>*);
+ static std::unique_ptr<SVGAnimatedType> createLength(SVGLength*);
+ static std::unique_ptr<SVGAnimatedType> createLengthList(SVGLengthList*);
+ static std::unique_ptr<SVGAnimatedType> createNumber(float*);
+ static std::unique_ptr<SVGAnimatedType> createNumberList(SVGNumberList*);
+ static std::unique_ptr<SVGAnimatedType> createNumberOptionalNumber(std::pair<float, float>*);
+ static std::unique_ptr<SVGAnimatedType> createPath(std::unique_ptr<SVGPathByteStream>);
+ static std::unique_ptr<SVGAnimatedType> createPointList(SVGPointList*);
+ static std::unique_ptr<SVGAnimatedType> createPreserveAspectRatio(SVGPreserveAspectRatio*);
+ static std::unique_ptr<SVGAnimatedType> createRect(FloatRect*);
+ static std::unique_ptr<SVGAnimatedType> createString(String*);
+ static std::unique_ptr<SVGAnimatedType> createTransformList(SVGTransformList*);
static bool supportsAnimVal(AnimatedPropertyType);
AnimatedPropertyType type() const { return m_type; }
String valueAsString();
bool setValueAsString(const QualifiedName&, const String&);
-
-private:
- SVGAnimatedType(AnimatedPropertyType);
+private:
AnimatedPropertyType m_type;
union DataUnion {
SVGTransformList* transformList;
} m_data;
};
-
+
} // namespace WebCore
#endif // ENABLE(SVG)
SVGAnimatedTypeAnimator::~SVGAnimatedTypeAnimator()
{ }
-void SVGAnimatedTypeAnimator::calculateFromAndToValues(OwnPtr<SVGAnimatedType>& from, OwnPtr<SVGAnimatedType>& to, const String& fromString, const String& toString)
+void SVGAnimatedTypeAnimator::calculateFromAndToValues(std::unique_ptr<SVGAnimatedType>& from, std::unique_ptr<SVGAnimatedType>& to, const String& fromString, const String& toString)
{
from = constructFromString(fromString);
to = constructFromString(toString);
}
-void SVGAnimatedTypeAnimator::calculateFromAndByValues(OwnPtr<SVGAnimatedType>& from, OwnPtr<SVGAnimatedType>& to, const String& fromString, const String& byString)
+void SVGAnimatedTypeAnimator::calculateFromAndByValues(std::unique_ptr<SVGAnimatedType>& from, std::unique_ptr<SVGAnimatedType>& to, const String& fromString, const String& byString)
{
from = constructFromString(fromString);
to = constructFromString(byString);
#include "SVGAnimatedProperty.h"
#include "SVGAnimatedType.h"
#include "SVGElementInstance.h"
-#include <wtf/PassOwnPtr.h>
+#include <wtf/StdLibExtras.h>
namespace WebCore {
WTF_MAKE_FAST_ALLOCATED;
public:
virtual ~SVGAnimatedTypeAnimator();
- virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&) = 0;
+ virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&) = 0;
- virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) = 0;
+ virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) = 0;
virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) = 0;
virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType*) = 0;
virtual void animValWillChange(const SVGElementAnimatedPropertyList&) = 0;
virtual void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*) = 0;
virtual float calculateDistance(const String& fromString, const String& toString) = 0;
- void calculateFromAndToValues(OwnPtr<SVGAnimatedType>&, OwnPtr<SVGAnimatedType>&, const String& fromString, const String& toString);
- void calculateFromAndByValues(OwnPtr<SVGAnimatedType>&, OwnPtr<SVGAnimatedType>&, const String& fromString, const String& byString);
+ void calculateFromAndToValues(std::unique_ptr<SVGAnimatedType>&, std::unique_ptr<SVGAnimatedType>&, const String& fromString, const String& toString);
+ void calculateFromAndByValues(std::unique_ptr<SVGAnimatedType>&, std::unique_ptr<SVGAnimatedType>&, const String& fromString, const String& byString);
void setContextElement(SVGElement* contextElement) { m_contextElement = contextElement; }
AnimatedPropertyType type() const { return m_type; }
class SVGAnimatorFactory {
public:
- static PassOwnPtr<SVGAnimatedTypeAnimator> create(SVGAnimationElement* animationElement, SVGElement* contextElement, AnimatedPropertyType attributeType)
+ static std::unique_ptr<SVGAnimatedTypeAnimator> create(SVGAnimationElement* animationElement, SVGElement* contextElement, AnimatedPropertyType attributeType)
{
ASSERT(animationElement);
ASSERT(contextElement);
switch (attributeType) {
case AnimatedAngle:
- return adoptPtr(new SVGAnimatedAngleAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedAngleAnimator>(animationElement, contextElement);
case AnimatedBoolean:
- return adoptPtr(new SVGAnimatedBooleanAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedBooleanAnimator>(animationElement, contextElement);
case AnimatedColor:
- return adoptPtr(new SVGAnimatedColorAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedColorAnimator>(animationElement, contextElement);
case AnimatedEnumeration:
- return adoptPtr(new SVGAnimatedEnumerationAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedEnumerationAnimator>(animationElement, contextElement);
case AnimatedInteger:
- return adoptPtr(new SVGAnimatedIntegerAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedIntegerAnimator>(animationElement, contextElement);
case AnimatedIntegerOptionalInteger:
- return adoptPtr(new SVGAnimatedIntegerOptionalIntegerAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedIntegerOptionalIntegerAnimator>(animationElement, contextElement);
case AnimatedLength:
- return adoptPtr(new SVGAnimatedLengthAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedLengthAnimator>(animationElement, contextElement);
case AnimatedLengthList:
- return adoptPtr(new SVGAnimatedLengthListAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedLengthListAnimator>(animationElement, contextElement);
case AnimatedNumber:
- return adoptPtr(new SVGAnimatedNumberAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedNumberAnimator>(animationElement, contextElement);
case AnimatedNumberList:
- return adoptPtr(new SVGAnimatedNumberListAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedNumberListAnimator>(animationElement, contextElement);
case AnimatedNumberOptionalNumber:
- return adoptPtr(new SVGAnimatedNumberOptionalNumberAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedNumberOptionalNumberAnimator>(animationElement, contextElement);
case AnimatedPath:
- return adoptPtr(new SVGAnimatedPathAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedPathAnimator>(animationElement, contextElement);
case AnimatedPoints:
- return adoptPtr(new SVGAnimatedPointListAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedPointListAnimator>(animationElement, contextElement);
case AnimatedPreserveAspectRatio:
- return adoptPtr(new SVGAnimatedPreserveAspectRatioAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedPreserveAspectRatioAnimator>(animationElement, contextElement);
case AnimatedRect:
- return adoptPtr(new SVGAnimatedRectAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedRectAnimator>(animationElement, contextElement);
case AnimatedString:
- return adoptPtr(new SVGAnimatedStringAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedStringAnimator>(animationElement, contextElement);
case AnimatedTransformList:
- return adoptPtr(new SVGAnimatedTransformListAnimator(animationElement, contextElement));
+ return std::make_unique<SVGAnimatedTransformListAnimator>(animationElement, contextElement);
case AnimatedUnknown:
break;
}
private:
SVGAnimatorFactory() { }
-
};
-
+
} // namespace WebCore
#endif // ENABLE(SVG)
SVGDocumentExtensions::SVGDocumentExtensions(Document* document)
: m_document(document)
- , m_resourcesCache(adoptPtr(new SVGResourcesCache))
+ , m_resourcesCache(std::make_unique<SVGResourcesCache>())
{
}
// In the future we should refactor the use-element to avoid this. See https://webkit.org/b/53704
Vector<RefPtr<SVGSVGElement>> timeContainers;
timeContainers.appendRange(m_timeContainers.begin(), m_timeContainers.end());
- Vector<RefPtr<SVGSVGElement>>::iterator end = timeContainers.end();
- for (Vector<RefPtr<SVGSVGElement>>::iterator itr = timeContainers.begin(); itr != end; ++itr)
- (*itr)->timeContainer()->begin();
+ auto end = timeContainers.end();
+ for (auto it = timeContainers.begin(); it != end; ++it)
+ (*it)->timeContainer()->begin();
}
-
+
void SVGDocumentExtensions::pauseAnimations()
{
- HashSet<SVGSVGElement*>::iterator end = m_timeContainers.end();
- for (HashSet<SVGSVGElement*>::iterator itr = m_timeContainers.begin(); itr != end; ++itr)
- (*itr)->pauseAnimations();
+ auto end = m_timeContainers.end();
+ for (auto it = m_timeContainers.begin(); it != end; ++it)
+ (*it)->pauseAnimations();
}
void SVGDocumentExtensions::unpauseAnimations()
{
- HashSet<SVGSVGElement*>::iterator end = m_timeContainers.end();
- for (HashSet<SVGSVGElement*>::iterator itr = m_timeContainers.begin(); itr != end; ++itr)
- (*itr)->unpauseAnimations();
+ auto end = m_timeContainers.end();
+ for (auto it = m_timeContainers.begin(); it != end; ++it)
+ (*it)->unpauseAnimations();
}
void SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements()
Vector<RefPtr<SVGSVGElement>> timeContainers;
timeContainers.appendRange(m_timeContainers.begin(), m_timeContainers.end());
- Vector<RefPtr<SVGSVGElement>>::iterator end = timeContainers.end();
- for (Vector<RefPtr<SVGSVGElement>>::iterator it = timeContainers.begin(); it != end; ++it) {
+ auto end = timeContainers.end();
+ for (auto it = timeContainers.begin(); it != end; ++it) {
SVGSVGElement* outerSVG = (*it).get();
if (!outerSVG->isOutermostSVGSVGElement())
continue;
if (id.isEmpty())
return;
- HashMap<AtomicString, OwnPtr<SVGPendingElements>>::AddResult result = m_pendingResources.add(id, nullptr);
+ auto result = m_pendingResources.add(id, nullptr);
if (result.isNewEntry)
- result.iterator->value = adoptPtr(new SVGPendingElements);
+ result.iterator->value = std::make_unique<SVGPendingElements>();
result.iterator->value->add(element);
element->setHasPendingResources();
ASSERT(element);
- HashMap<AtomicString, OwnPtr<SVGPendingElements>>::const_iterator end = m_pendingResources.end();
- for (HashMap<AtomicString, OwnPtr<SVGPendingElements>>::const_iterator it = m_pendingResources.begin(); it != end; ++it) {
+ auto end = m_pendingResources.end();
+ for (auto it = m_pendingResources.begin(); it != end; ++it) {
SVGPendingElements* elements = it->value.get();
ASSERT(elements);
// Remove the element from pending resources.
if (!m_pendingResources.isEmpty() && element->hasPendingResources()) {
Vector<AtomicString> toBeRemoved;
- HashMap<AtomicString, OwnPtr<SVGPendingElements>>::iterator end = m_pendingResources.end();
- for (HashMap<AtomicString, OwnPtr<SVGPendingElements>>::iterator it = m_pendingResources.begin(); it != end; ++it) {
+ auto end = m_pendingResources.end();
+ for (auto it = m_pendingResources.begin(); it != end; ++it) {
SVGPendingElements* elements = it->value.get();
ASSERT(elements);
ASSERT(!elements->isEmpty());
clearHasPendingResourcesIfPossible(element);
// We use the removePendingResource function here because it deals with set lifetime correctly.
- Vector<AtomicString>::iterator vectorEnd = toBeRemoved.end();
- for (Vector<AtomicString>::iterator it = toBeRemoved.begin(); it != vectorEnd; ++it)
+ auto vectorEnd = toBeRemoved.end();
+ for (auto it = toBeRemoved.begin(); it != vectorEnd; ++it)
removePendingResource(*it);
}
// Remove the element from pending resources that were scheduled for removal.
if (!m_pendingResourcesForRemoval.isEmpty()) {
Vector<AtomicString> toBeRemoved;
- HashMap<AtomicString, OwnPtr<SVGPendingElements>>::iterator end = m_pendingResourcesForRemoval.end();
- for (HashMap<AtomicString, OwnPtr<SVGPendingElements>>::iterator it = m_pendingResourcesForRemoval.begin(); it != end; ++it) {
+ auto end = m_pendingResourcesForRemoval.end();
+ for (auto it = m_pendingResourcesForRemoval.begin(); it != end; ++it) {
SVGPendingElements* elements = it->value.get();
ASSERT(elements);
ASSERT(!elements->isEmpty());
}
// We use the removePendingResourceForRemoval function here because it deals with set lifetime correctly.
- Vector<AtomicString>::iterator vectorEnd = toBeRemoved.end();
- for (Vector<AtomicString>::iterator it = toBeRemoved.begin(); it != vectorEnd; ++it)
+ auto vectorEnd = toBeRemoved.end();
+ for (auto it = toBeRemoved.begin(); it != vectorEnd; ++it)
removePendingResourceForRemoval(*it);
}
}
-OwnPtr<SVGDocumentExtensions::SVGPendingElements> SVGDocumentExtensions::removePendingResource(const AtomicString& id)
+std::unique_ptr<SVGDocumentExtensions::SVGPendingElements> SVGDocumentExtensions::removePendingResource(const AtomicString& id)
{
ASSERT(m_pendingResources.contains(id));
return m_pendingResources.take(id);
}
-OwnPtr<SVGDocumentExtensions::SVGPendingElements> SVGDocumentExtensions::removePendingResourceForRemoval(const AtomicString& id)
+std::unique_ptr<SVGDocumentExtensions::SVGPendingElements> SVGDocumentExtensions::removePendingResourceForRemoval(const AtomicString& id)
{
ASSERT(m_pendingResourcesForRemoval.contains(id));
return m_pendingResourcesForRemoval.take(id);
ASSERT(!m_pendingResourcesForRemoval.contains(id));
- OwnPtr<SVGPendingElements> existing = m_pendingResources.take(id);
+ std::unique_ptr<SVGPendingElements> existing = m_pendingResources.take(id);
if (existing && !existing->isEmpty())
- m_pendingResourcesForRemoval.add(id, existing.release());
+ m_pendingResourcesForRemoval.add(id, std::move(existing));
}
Element* SVGDocumentExtensions::removeElementFromPendingResourcesForRemoval(const AtomicString& id)
if (!resourceSet || resourceSet->isEmpty())
return 0;
- SVGPendingElements::iterator firstElement = resourceSet->begin();
+ auto firstElement = resourceSet->begin();
Element* element = *firstElement;
resourceSet->remove(firstElement);
HashSet<SVGElement*>* SVGDocumentExtensions::setOfElementsReferencingTarget(SVGElement* referencedElement) const
{
ASSERT(referencedElement);
- const HashMap<SVGElement*, OwnPtr<HashSet<SVGElement*>>>::const_iterator it = m_elementDependencies.find(referencedElement);
+ const auto it = m_elementDependencies.find(referencedElement);
if (it == m_elementDependencies.end())
return 0;
return it->value.get();
return;
}
- OwnPtr<HashSet<SVGElement*>> elements = adoptPtr(new HashSet<SVGElement*>);
+ auto elements = std::make_unique<HashSet<SVGElement*>>();
elements->add(referencingElement);
- m_elementDependencies.set(referencedElement, elements.release());
+ m_elementDependencies.set(referencedElement, std::move(elements));
}
void SVGDocumentExtensions::removeAllTargetReferencesForElement(SVGElement* referencingElement)
toBeRemoved.append(referencedElement);
}
- Vector<SVGElement*>::iterator vectorEnd = toBeRemoved.end();
- for (Vector<SVGElement*>::iterator it = toBeRemoved.begin(); it != vectorEnd; ++it)
+ auto vectorEnd = toBeRemoved.end();
+ for (auto it = toBeRemoved.begin(); it != vectorEnd; ++it)
m_elementDependencies.remove(*it);
}
void SVGDocumentExtensions::rebuildAllElementReferencesForTarget(SVGElement* referencedElement)
{
ASSERT(referencedElement);
- HashMap<SVGElement*, OwnPtr<HashSet<SVGElement*>>>::iterator it = m_elementDependencies.find(referencedElement);
+ auto it = m_elementDependencies.find(referencedElement);
if (it == m_elementDependencies.end())
return;
ASSERT(it->key == referencedElement);
Vector<SVGElement*> toBeNotified;
HashSet<SVGElement*>* referencingElements = it->value.get();
- HashSet<SVGElement*>::iterator setEnd = referencingElements->end();
- for (HashSet<SVGElement*>::iterator setIt = referencingElements->begin(); setIt != setEnd; ++setIt)
+ auto setEnd = referencingElements->end();
+ for (auto setIt = referencingElements->begin(); setIt != setEnd; ++setIt)
toBeNotified.append(*setIt);
// Force rebuilding the referencingElement so it knows about this change.
- Vector<SVGElement*>::iterator vectorEnd = toBeNotified.end();
- for (Vector<SVGElement*>::iterator vectorIt = toBeNotified.begin(); vectorIt != vectorEnd; ++vectorIt) {
+ auto vectorEnd = toBeNotified.end();
+ for (auto vectorIt = toBeNotified.begin(); vectorIt != vectorEnd; ++vectorIt) {
// Before rebuilding referencingElement ensure it was not removed from under us.
if (HashSet<SVGElement*>* referencingElements = setOfElementsReferencingTarget(referencedElement)) {
if (referencingElements->contains(*vectorIt))
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
-#include <wtf/PassOwnPtr.h>
#include <wtf/text/AtomicStringHash.h>
namespace WebCore {
HashSet<SVGFontFaceElement*> m_svgFontFaceElements;
#endif
HashMap<AtomicString, RenderSVGResourceContainer*> m_resources;
- HashMap<AtomicString, OwnPtr<SVGPendingElements>> m_pendingResources; // Resources that are pending.
- HashMap<AtomicString, OwnPtr<SVGPendingElements>> m_pendingResourcesForRemoval; // Resources that are pending and scheduled for removal.
- HashMap<SVGElement*, OwnPtr<HashSet<SVGElement*>>> m_elementDependencies;
- OwnPtr<SVGResourcesCache> m_resourcesCache;
+ HashMap<AtomicString, std::unique_ptr<SVGPendingElements>> m_pendingResources; // Resources that are pending.
+ HashMap<AtomicString, std::unique_ptr<SVGPendingElements>> m_pendingResourcesForRemoval; // Resources that are pending and scheduled for removal.
+ HashMap<SVGElement*, std::unique_ptr<HashSet<SVGElement*>>> m_elementDependencies;
+ std::unique_ptr<SVGResourcesCache> m_resourcesCache;
public:
// This HashMap contains a list of pending resources. Pending resources, are such
bool isElementPendingResource(Element*, const AtomicString& id) const;
void clearHasPendingResourcesIfPossible(Element*);
void removeElementFromPendingResources(Element*);
- OwnPtr<SVGPendingElements> removePendingResource(const AtomicString& id);
+ std::unique_ptr<SVGPendingElements> removePendingResource(const AtomicString& id);
// The following two functions are used for scheduling a pending resource to be removed.
void markPendingResourcesForRemoval(const AtomicString&);
Element* removeElementFromPendingResourcesForRemoval(const AtomicString&);
private:
- OwnPtr<SVGPendingElements> removePendingResourceForRemoval(const AtomicString&);
+ std::unique_ptr<SVGPendingElements> removePendingResourceForRemoval(const AtomicString&);
};
}
class SVGFontData : public SimpleFontData::AdditionalFontData {
public:
- static PassOwnPtr<SVGFontData> create(SVGFontFaceElement* element)
- {
- return adoptPtr(new SVGFontData(element));
- }
-
+ explicit SVGFontData(SVGFontFaceElement*);
virtual ~SVGFontData() { }
virtual void initializeFontData(SimpleFontData*, float fontSize);
float verticalAdvanceY() const { return m_verticalAdvanceY; }
private:
- SVGFontData(SVGFontFaceElement*);
-
bool fillBMPGlyphs(SVGFontElement*, GlyphPage* , unsigned offset, unsigned length, UChar* buffer, const SimpleFontData*) const;
bool fillNonBMPGlyphs(SVGFontElement*, GlyphPage* , unsigned offset, unsigned length, UChar* buffer, const SimpleFontData*) const;
END_REGISTER_ANIMATED_PROPERTIES
inline SVGFontElement::SVGFontElement(const QualifiedName& tagName, Document& document)
- : SVGElement(tagName, document)
+ : SVGElement(tagName, document)
, m_missingGlyph(0)
, m_isGlyphCacheValid(false)
{
glyphs.clear();
continue;
}
-
+
// This glyph is never meant to be used for rendering, only as identifier as a part of a ligature.
SVGGlyph newGlyphPart;
newGlyphPart.isPartOfLigature = true;
if (unicodeMap.contains(*uIt))
unicodeMap.get(*uIt)->append(svgKerning);
else {
- OwnPtr<SVGKerningVector> newVector = adoptPtr(new SVGKerningVector);
+ auto newVector = std::make_unique<SVGKerningVector>();
newVector->append(svgKerning);
- unicodeMap.add(*uIt, newVector.release());
+ unicodeMap.add(*uIt, std::move(newVector));
}
}
if (glyphMap.contains(*gIt))
glyphMap.get(*gIt)->append(svgKerning);
else {
- OwnPtr<SVGKerningVector> newVector = adoptPtr(new SVGKerningVector);
+ auto newVector = std::make_unique<SVGKerningVector>();
newVector->append(svgKerning);
- glyphMap.add(*gIt, newVector.release());
+ glyphMap.add(*gIt, std::move(newVector));
}
}
return 0;
}
-
+
float SVGFontElement::horizontalKerningForPairOfStringsAndGlyphs(const String& u1, const String& g1, const String& u2, const String& g2) const
{
if (m_horizontalKerningMap.isEmpty())
ensureGlyphCache();
return m_glyphMap.svgGlyphForGlyph(glyph);
}
-
+
Glyph SVGFontElement::missingGlyph()
{
ensureGlyphCache();
typedef Vector<SVGKerning> SVGKerningVector;
struct SVGKerningMap {
- HashMap<String, OwnPtr<SVGKerningVector>> unicodeMap;
- HashMap<String, OwnPtr<SVGKerningVector>> glyphMap;
+ HashMap<String, std::unique_ptr<SVGKerningVector>> unicodeMap;
+ HashMap<String, std::unique_ptr<SVGKerningVector>> glyphMap;
Vector<SVGKerningPair> kerningUnicodeRangeMap;
bool isEmpty() const { return unicodeMap.isEmpty() && glyphMap.isEmpty() && kerningUnicodeRangeMap.isEmpty(); }
void insert(const SVGKerningPair&);
};
-class SVGMissingGlyphElement;
+class SVGMissingGlyphElement;
class SVGFontElement FINAL : public SVGElement
, public SVGExternalResourcesRequired {
AffineTransform* SVGGraphicsElement::supplementalTransform()
{
if (!m_supplementalTransform)
- m_supplementalTransform = adoptPtr(new AffineTransform);
+ m_supplementalTransform = std::make_unique<AffineTransform>();
return m_supplementalTransform.get();
}
virtual void synchronizeSystemLanguage() OVERRIDE { SVGTests::synchronizeSystemLanguage(this); }
// Used by <animateMotion>
- OwnPtr<AffineTransform> m_supplementalTransform;
+ std::unique_ptr<AffineTransform> m_supplementalTransform;
};
void isSVGGraphicsElement(const SVGGraphicsElement&); // Catch unnecessary runtime check of type known at compile time.
#include "FloatPoint.h"
#include "SVGPathByteStream.h"
#include "SVGPathSource.h"
-#include <wtf/PassOwnPtr.h>
namespace WebCore {
class SVGPathByteStreamSource : public SVGPathSource {
public:
- static PassOwnPtr<SVGPathByteStreamSource> create(SVGPathByteStream* stream)
- {
- return adoptPtr(new SVGPathByteStreamSource(stream));
- }
+ explicit SVGPathByteStreamSource(SVGPathByteStream*);
private:
- SVGPathByteStreamSource(SVGPathByteStream*);
-
virtual bool hasMoreData() const;
virtual bool moveToNextToken() { return true; }
virtual bool parseSVGSegmentType(SVGPathSegType&);
#if ENABLE(SVG)
#include "SVGPathConsumer.h"
#include "SVGPathSeg.h"
-#include <wtf/PassOwnPtr.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
#include "SVGPathSeg.h"
#include "SVGPathSegList.h"
#include "SVGPathSource.h"
-#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
namespace WebCore {
class SVGPathSegListSource : public SVGPathSource {
public:
- static PassOwnPtr<SVGPathSegListSource> create(const SVGPathSegList& pathSegList)
- {
- return adoptPtr(new SVGPathSegListSource(pathSegList));
- }
+ explicit SVGPathSegListSource(const SVGPathSegList&);
private:
- SVGPathSegListSource(const SVGPathSegList&);
-
virtual bool hasMoreData() const;
virtual bool moveToNextToken() { return true; }
virtual bool parseSVGSegmentType(SVGPathSegType&);
#if ENABLE(SVG)
#include "SVGPathSource.h"
-#include <wtf/PassOwnPtr.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class SVGPathStringSource : public SVGPathSource {
public:
- static PassOwnPtr<SVGPathStringSource> create(const String& string)
- {
- return adoptPtr(new SVGPathStringSource(string));
- }
+ explicit SVGPathStringSource(const String&);
private:
- SVGPathStringSource(const String&);
-
virtual bool hasMoreData() const;
virtual bool moveToNextToken();
virtual bool parseSVGSegmentType(SVGPathSegType&);
SVGPathBuilder* builder = globalSVGPathBuilder(result);
- OwnPtr<SVGPathStringSource> source = SVGPathStringSource::create(d);
+ auto source = std::make_unique<SVGPathStringSource>(d);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(NormalizedParsing);
parser->cleanup();
SVGPathByteStreamBuilder* builder = globalSVGPathByteStreamBuilder(result);
- OwnPtr<SVGPathSegListSource> source = SVGPathSegListSource::create(list);
+ auto source = std::make_unique<SVGPathSegListSource>(list);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(parsingMode);
parser->cleanup();
auto appendedByteStream = std::make_unique<SVGPathByteStream>();
SVGPathByteStreamBuilder* builder = globalSVGPathByteStreamBuilder(appendedByteStream.get());
- OwnPtr<SVGPathSegListSource> source = SVGPathSegListSource::create(appendedItemList);
+ auto source = std::make_unique<SVGPathSegListSource>(appendedItemList);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(parsingMode, false);
parser->cleanup();
SVGPathBuilder* builder = globalSVGPathBuilder(result);
- OwnPtr<SVGPathByteStreamSource> source = SVGPathByteStreamSource::create(stream);
+ auto source = std::make_unique<SVGPathByteStreamSource>(stream);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(NormalizedParsing);
parser->cleanup();
{
ASSERT(stream);
if (stream->isEmpty())
- return true;
+ return true;
SVGPathSegListBuilder* builder = globalSVGPathSegListBuilder(element, parsingMode == NormalizedParsing ? PathSegNormalizedRole : PathSegUnalteredRole, result);
- OwnPtr<SVGPathByteStreamSource> source = SVGPathByteStreamSource::create(stream);
+ auto source = std::make_unique<SVGPathByteStreamSource>(stream);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(parsingMode);
parser->cleanup();
{
ASSERT(stream);
if (stream->isEmpty())
- return true;
+ return true;
SVGPathStringBuilder* builder = globalSVGPathStringBuilder();
- OwnPtr<SVGPathByteStreamSource> source = SVGPathByteStreamSource::create(stream);
+ auto source = std::make_unique<SVGPathByteStreamSource>(stream);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(parsingMode);
result = builder->result();
SVGPathStringBuilder* builder = globalSVGPathStringBuilder();
- OwnPtr<SVGPathSegListSource> source = SVGPathSegListSource::create(list);
+ auto source = std::make_unique<SVGPathSegListSource>(list);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(parsingMode);
result = builder->result();
SVGPathByteStreamBuilder* builder = globalSVGPathByteStreamBuilder(result);
- OwnPtr<SVGPathStringSource> source = SVGPathStringSource::create(d);
+ auto source = std::make_unique<SVGPathStringSource>(d);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(parsingMode);
parser->cleanup();
SVGPathByteStreamBuilder* builder = globalSVGPathByteStreamBuilder(result);
- OwnPtr<SVGPathByteStreamSource> fromSource = SVGPathByteStreamSource::create(fromStream);
- OwnPtr<SVGPathByteStreamSource> toSource = SVGPathByteStreamSource::create(toStream);
+ auto fromSource = std::make_unique<SVGPathByteStreamSource>(fromStream);
+ auto toSource = std::make_unique<SVGPathByteStreamSource>(toStream);
SVGPathBlender* blender = globalSVGPathBlender();
bool ok = blender->blendAnimatedPath(progress, fromSource.get(), toSource.get(), builder);
blender->cleanup();
auto fromStreamCopy = fromStream->copy();
fromStream->clear();
- OwnPtr<SVGPathByteStreamSource> fromSource = SVGPathByteStreamSource::create(fromStreamCopy.get());
- OwnPtr<SVGPathByteStreamSource> bySource = SVGPathByteStreamSource::create(byStream);
+ auto fromSource = std::make_unique<SVGPathByteStreamSource>(fromStreamCopy.get());
+ auto bySource = std::make_unique<SVGPathByteStreamSource>(byStream);
SVGPathBlender* blender = globalSVGPathBlender();
bool ok = blender->addAnimatedPath(fromSource.get(), bySource.get(), builder, repeatCount);
blender->cleanup();
PathTraversalState traversalState(PathTraversalState::TraversalSegmentAtLength);
SVGPathTraversalStateBuilder* builder = globalSVGPathTraversalStateBuilder(traversalState, length);
- OwnPtr<SVGPathByteStreamSource> source = SVGPathByteStreamSource::create(stream);
+ auto source = std::make_unique<SVGPathByteStreamSource>(stream);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(NormalizedParsing);
pathSeg = builder->pathSegmentIndex();
ASSERT(stream);
if (stream->isEmpty())
return false;
-
+
PathTraversalState traversalState(PathTraversalState::TraversalTotalLength);
SVGPathTraversalStateBuilder* builder = globalSVGPathTraversalStateBuilder(traversalState, 0);
-
- OwnPtr<SVGPathByteStreamSource> source = SVGPathByteStreamSource::create(stream);
+
+ auto source = std::make_unique<SVGPathByteStreamSource>(stream);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(NormalizedParsing);
totalLength = builder->totalLength();
ASSERT(stream);
if (stream->isEmpty())
return false;
-
+
PathTraversalState traversalState(PathTraversalState::TraversalPointAtLength);
SVGPathTraversalStateBuilder* builder = globalSVGPathTraversalStateBuilder(traversalState, length);
-
- OwnPtr<SVGPathByteStreamSource> source = SVGPathByteStreamSource::create(stream);
+
+ auto source = std::make_unique<SVGPathByteStreamSource>(stream);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(NormalizedParsing);
point = builder->currentPoint();
#if ENABLE(SVG)
#include "SVGPathConsumer.h"
#include "SVGPoint.h"
-#include <wtf/OwnPtr.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
#endif
ElementAttributePair key(target, attributeName);
- OwnPtr<AnimationsVector>& scheduled = m_scheduledAnimations.add(key, nullptr).iterator->value;
+ std::unique_ptr<AnimationsVector>& scheduled = m_scheduledAnimations.add(key, nullptr).iterator->value;
if (!scheduled)
- scheduled = adoptPtr(new AnimationsVector);
+ scheduled = std::make_unique<AnimationsVector>();
ASSERT(!scheduled->contains(animation));
scheduled->append(animation);
typedef pair<SVGElement*, QualifiedName> ElementAttributePair;
typedef Vector<SVGSMILElement*> AnimationsVector;
- typedef HashMap<ElementAttributePair, OwnPtr<AnimationsVector>> GroupedAnimationsMap;
+ typedef HashMap<ElementAttributePair, std::unique_ptr<AnimationsVector>> GroupedAnimationsMap;
GroupedAnimationsMap m_scheduledAnimations;
SVGSVGElement* m_ownerSVGElement;
{
if (m_page) {
// Store m_page in a local variable, clearing m_page, so that SVGImageChromeClient knows we're destructed.
- OwnPtr<Page> currentPage = m_page.release();
+ std::unique_ptr<Page> currentPage = std::move(m_page);
currentPage->mainFrame().loader().frameDetached(); // Break both the loader and view references to the frame
}
if (allDataReceived) {
Page::PageClients pageClients;
fillWithEmptyClients(pageClients);
- m_chromeClient = adoptPtr(new SVGImageChromeClient(this));
+ m_chromeClient = std::make_unique<SVGImageChromeClient>(this);
pageClients.chromeClient = m_chromeClient.get();
// FIXME: If this SVG ends up loading itself, we might leak the world.
// This will become an issue when SVGImage will be able to load other
// SVGImage objects, but we're safe now, because SVGImage can only be
// loaded by a top-level document.
- m_page = adoptPtr(new Page(pageClients));
+ m_page = std::make_unique<Page>(pageClients);
m_page->settings().setMediaEnabled(false);
m_page->settings().setScriptEnabled(false);
m_page->settings().setPluginsEnabled(false);
m_intrinsicSize = containerSize();
}
- return m_page;
+ return m_page != nullptr;
}
String SVGImage::filenameExtension() const
void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const AffineTransform&, const FloatPoint&, ColorSpace,
CompositeOperator, const FloatRect&);
- OwnPtr<SVGImageChromeClient> m_chromeClient;
- OwnPtr<Page> m_page;
+ std::unique_ptr<SVGImageChromeClient> m_chromeClient;
+ std::unique_ptr<Page> m_page;
IntSize m_intrinsicSize;
};
#include "Image.h"
#include "IntSize.h"
#include <wtf/HashMap.h>
-#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
namespace WebCore {
class SVGImageCache {
WTF_MAKE_FAST_ALLOCATED;
public:
+ explicit SVGImageCache(SVGImage*);
~SVGImageCache();
- static PassOwnPtr<SVGImageCache> create(SVGImage* image)
- {
- return adoptPtr(new SVGImageCache(image));
- }
-
void removeClientFromCache(const CachedImageClient*);
void setContainerSizeForRenderer(const CachedImageClient*, const IntSize&, float);
Image* imageForRenderer(const RenderObject*);
private:
- SVGImageCache(SVGImage*);
-
typedef HashMap<const CachedImageClient*, RefPtr<SVGImageForContainer>> ImageForContainerMap;
SVGImage* m_svgImage;
#include "SVGAnimatedProperty.h"
#include "SVGPropertyInfo.h"
-#include <wtf/PassOwnPtr.h>
namespace WebCore {
return;
}
// FIXME: This does a second hash table lookup, but with HashMap::add we could instead do only one.
- OwnPtr<PropertiesVector> vector = adoptPtr(new PropertiesVector);
+ auto vector = std::make_unique<PropertiesVector>();
vector->append(info);
- m_map.set(info->attributeName, vector.release());
+ m_map.set(info->attributeName, std::move(vector));
}
void SVGAttributeToPropertyMap::animatedPropertiesForAttribute(SVGElement* ownerType, const QualifiedName& attributeName, Vector<RefPtr<SVGAnimatedProperty>>& properties)
PassRefPtr<SVGAnimatedProperty> animatedProperty(SVGElement* contextElement, const QualifiedName& attributeName, const SVGPropertyInfo*);
typedef Vector<const SVGPropertyInfo*> PropertiesVector;
- typedef HashMap<QualifiedName, OwnPtr<PropertiesVector>> AttributeToPropertiesMap;
+ typedef HashMap<QualifiedName, std::unique_ptr<PropertiesVector>> AttributeToPropertiesMap;
AttributeToPropertiesMap m_map;
};