[SVG] Convert OwnPtr/PassOwnPtr to std::unique_ptr
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Nov 2013 17:22:59 +0000 (17:22 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Nov 2013 17:22:59 +0000 (17:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=124382

Patch by Sergio Correia <sergio.correia@openbossa.org> on 2013-11-19
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159503 268f45cc-cd09-0410-ab3c-d52691b4dbfc

68 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSFontFaceSource.cpp
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedImage.h
Source/WebCore/platform/graphics/SimpleFontData.cpp
Source/WebCore/platform/graphics/SimpleFontData.h
Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp
Source/WebCore/svg/SVGAnimateElement.cpp
Source/WebCore/svg/SVGAnimateElement.h
Source/WebCore/svg/SVGAnimatedAngle.cpp
Source/WebCore/svg/SVGAnimatedAngle.h
Source/WebCore/svg/SVGAnimatedBoolean.cpp
Source/WebCore/svg/SVGAnimatedBoolean.h
Source/WebCore/svg/SVGAnimatedColor.cpp
Source/WebCore/svg/SVGAnimatedColor.h
Source/WebCore/svg/SVGAnimatedEnumeration.cpp
Source/WebCore/svg/SVGAnimatedEnumeration.h
Source/WebCore/svg/SVGAnimatedInteger.cpp
Source/WebCore/svg/SVGAnimatedInteger.h
Source/WebCore/svg/SVGAnimatedIntegerOptionalInteger.cpp
Source/WebCore/svg/SVGAnimatedIntegerOptionalInteger.h
Source/WebCore/svg/SVGAnimatedLength.cpp
Source/WebCore/svg/SVGAnimatedLength.h
Source/WebCore/svg/SVGAnimatedLengthList.cpp
Source/WebCore/svg/SVGAnimatedLengthList.h
Source/WebCore/svg/SVGAnimatedNumber.cpp
Source/WebCore/svg/SVGAnimatedNumber.h
Source/WebCore/svg/SVGAnimatedNumberList.cpp
Source/WebCore/svg/SVGAnimatedNumberList.h
Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.cpp
Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.h
Source/WebCore/svg/SVGAnimatedPath.cpp
Source/WebCore/svg/SVGAnimatedPath.h
Source/WebCore/svg/SVGAnimatedPointList.cpp
Source/WebCore/svg/SVGAnimatedPointList.h
Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.cpp
Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.h
Source/WebCore/svg/SVGAnimatedRect.cpp
Source/WebCore/svg/SVGAnimatedRect.h
Source/WebCore/svg/SVGAnimatedString.cpp
Source/WebCore/svg/SVGAnimatedString.h
Source/WebCore/svg/SVGAnimatedTransformList.cpp
Source/WebCore/svg/SVGAnimatedTransformList.h
Source/WebCore/svg/SVGAnimatedType.cpp
Source/WebCore/svg/SVGAnimatedType.h
Source/WebCore/svg/SVGAnimatedTypeAnimator.cpp
Source/WebCore/svg/SVGAnimatedTypeAnimator.h
Source/WebCore/svg/SVGAnimatorFactory.h
Source/WebCore/svg/SVGDocumentExtensions.cpp
Source/WebCore/svg/SVGDocumentExtensions.h
Source/WebCore/svg/SVGFontData.h
Source/WebCore/svg/SVGFontElement.cpp
Source/WebCore/svg/SVGFontElement.h
Source/WebCore/svg/SVGGraphicsElement.cpp
Source/WebCore/svg/SVGGraphicsElement.h
Source/WebCore/svg/SVGPathByteStreamSource.h
Source/WebCore/svg/SVGPathParser.h
Source/WebCore/svg/SVGPathSegListSource.h
Source/WebCore/svg/SVGPathStringSource.h
Source/WebCore/svg/SVGPathUtilities.cpp
Source/WebCore/svg/SVGPathUtilities.h
Source/WebCore/svg/animation/SMILTimeContainer.cpp
Source/WebCore/svg/animation/SMILTimeContainer.h
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebCore/svg/graphics/SVGImage.h
Source/WebCore/svg/graphics/SVGImageCache.h
Source/WebCore/svg/properties/SVGAttributeToPropertyMap.cpp
Source/WebCore/svg/properties/SVGAttributeToPropertyMap.h

index 4ba669d..7fb0cc5 100644 (file)
@@ -1,3 +1,83 @@
+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
index 6a9b66a..23ee019 100644 (file)
@@ -146,7 +146,7 @@ PassRefPtr<SimpleFontData> CSSFontFaceSource::getFontData(const FontDescription&
                         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
@@ -162,7 +162,7 @@ PassRefPtr<SimpleFontData> CSSFontFaceSource::getFontData(const FontDescription&
 #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 {
index 1d77029..94d9a07 100644 (file)
@@ -332,7 +332,7 @@ inline void CachedImage::createImage()
 #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
index 7b388b4..47a7cf3 100644 (file)
@@ -135,7 +135,7 @@ private:
 
     RefPtr<Image> m_image;
 #if ENABLE(SVG)
-    OwnPtr<SVGImageCache> m_svgImageCache;
+    std::unique_ptr<SVGImageCache> m_svgImageCache;
 #endif
     bool m_shouldPaintBrokenImage;
 };
index 32574a9..3235b40 100644 (file)
@@ -68,9 +68,9 @@ SimpleFontData::SimpleFontData(const FontPlatformData& platformData, bool isCust
 #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)
index e9a57e6..45a0f55 100644 (file)
@@ -85,9 +85,9 @@ public:
     }
 
     // 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();
@@ -130,7 +130,7 @@ public:
     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; }
 
@@ -167,7 +167,7 @@ public:
     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; }
@@ -223,13 +223,13 @@ public:
 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;
@@ -245,9 +245,9 @@ private:
     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;
@@ -255,14 +255,14 @@ private:
     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;
@@ -286,7 +286,7 @@ private:
 #if PLATFORM(MAC)
         mutable RetainPtr<CFMutableDictionaryRef> compositeFontReferences;
 #endif
-        
+
     private:
         DerivedFontData(bool custom)
             : forCustomFont(custom)
index d6c3c2f..99c5e1a 100644 (file)
@@ -179,7 +179,7 @@ void RenderSVGResourceContainer::registerResource()
         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);
index 6990663..4aab5e1 100644 (file)
@@ -325,14 +325,14 @@ void SVGAnimateElement::clearAnimatedType(SVGElement* targetElement)
         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;
     }
 
@@ -343,7 +343,7 @@ void SVGAnimateElement::clearAnimatedType(SVGElement* targetElement)
     }
 
     m_animatedProperties.clear();
-    m_animatedType.clear();
+    m_animatedType = nullptr;
 }
 
 void SVGAnimateElement::applyResultsToTarget()
@@ -434,10 +434,10 @@ void SVGAnimateElement::setAttributeName(const QualifiedName& attributeName)
 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;
 }
 
index 2204d42..ec5d2e8 100644 (file)
 #include "SVGAnimatedTypeAnimator.h"
 #include "SVGAnimationElement.h"
 #include "SVGNames.h"
-#include <wtf/OwnPtr.h>
 
 namespace WebCore {
-    
+
 class SVGAnimatedProperty;
 
 class SVGAnimateElement : public SVGAnimationElement {
@@ -40,7 +39,7 @@ public:
     virtual ~SVGAnimateElement();
 
     AnimatedPropertyType determineAnimatedPropertyType(SVGElement*) const;
-    
+
 protected:
     SVGAnimateElement(const QualifiedName&, Document&);
 
@@ -67,13 +66,13 @@ private:
 
     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.
index d1ee99b..4e2e97b 100644 (file)
@@ -32,9 +32,9 @@ SVGAnimatedAngleAnimator::SVGAnimatedAngleAnimator(SVGAnimationElement* animatio
 {
 }
 
-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;
@@ -44,10 +44,10 @@ PassOwnPtr<SVGAnimatedType> SVGAnimatedAngleAnimator::constructFromString(const
     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));
 }
index 50724b0..f1b5933 100644 (file)
@@ -44,8 +44,8 @@ public:
     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&);
index 73f72e6..ff1acdb 100644 (file)
@@ -31,14 +31,14 @@ SVGAnimatedBooleanAnimator::SVGAnimatedBooleanAnimator(SVGAnimationElement* anim
 {
 }
 
-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));
 }
index 57a241f..50c8ac0 100644 (file)
@@ -41,9 +41,9 @@ class SVGAnimatedBooleanAnimator : public SVGAnimatedTypeAnimator {
 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;
index f81b873..0cc0026 100644 (file)
@@ -34,11 +34,11 @@ SVGAnimatedColorAnimator::SVGAnimatedColorAnimator(SVGAnimationElement* animatio
 {
 }
 
-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)
index bb8b2fd..449edf0 100644 (file)
 #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&) { }
index 2ec7e3f..8c50700 100644 (file)
@@ -107,15 +107,15 @@ SVGAnimatedEnumerationAnimator::SVGAnimatedEnumerationAnimator(SVGAnimationEleme
 {
 }
 
-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));
 }
index 8447602..5f070c8 100644 (file)
@@ -41,8 +41,8 @@ public:
     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&);
index 8906731..f22ad45 100644 (file)
@@ -33,14 +33,14 @@ SVGAnimatedIntegerAnimator::SVGAnimatedIntegerAnimator(SVGAnimationElement* anim
 {
 }
 
-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));
 }
@@ -100,7 +100,7 @@ float SVGAnimatedIntegerAnimator::calculateDistance(const String& fromString, co
     int to = toString.toIntStrict();
     return abs(to - from);
 }
-    
+
 }
 
 #endif // ENABLE(SVG)
index 0b55c10..0cc415d 100644 (file)
@@ -48,8 +48,8 @@ public:
 
     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&);
index af37db2..2647bf2 100644 (file)
@@ -33,10 +33,10 @@ SVGAnimatedIntegerOptionalIntegerAnimator::SVGAnimatedIntegerOptionalIntegerAnim
 {
 }
 
-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)) {
@@ -46,10 +46,10 @@ PassOwnPtr<SVGAnimatedType> SVGAnimatedIntegerOptionalIntegerAnimator::construct
         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));
 }
index d810bd3..c40c146 100644 (file)
@@ -31,9 +31,9 @@ class SVGAnimatedIntegerOptionalIntegerAnimator : public SVGAnimatedTypeAnimator
 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&);
index 88e7b9f..cd97641 100644 (file)
@@ -40,12 +40,12 @@ static inline SVGLength& sharedSVGLength(SVGLengthMode mode, const String& value
     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));
 }
index 62a1119..1ce5d71 100644 (file)
@@ -43,8 +43,8 @@ public:
     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&);
index b6a23ac..a00a15d 100644 (file)
@@ -33,14 +33,14 @@ SVGAnimatedLengthListAnimator::SVGAnimatedLengthListAnimator(SVGAnimationElement
 {
 }
 
-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));
 }
index 86ffafe..2736726 100644 (file)
@@ -42,9 +42,9 @@ class SVGAnimatedLengthListAnimator : public SVGAnimatedTypeAnimator {
 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&);
@@ -53,7 +53,7 @@ public:
     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;
 };
index 3e1589c..351f393 100644 (file)
@@ -32,16 +32,16 @@ SVGAnimatedNumberAnimator::SVGAnimatedNumberAnimator(SVGAnimationElement* animat
 {
 }
 
-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));
 }
index 942d641..cae92af 100644 (file)
@@ -46,8 +46,8 @@ public:
     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&);
index 8b2ca4c..107b706 100644 (file)
@@ -32,14 +32,14 @@ SVGAnimatedNumberListAnimator::SVGAnimatedNumberListAnimator(SVGAnimationElement
 {
 }
 
-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));
 }
index b644599..7268945 100644 (file)
@@ -42,9 +42,9 @@ class SVGAnimatedNumberListAnimator : public SVGAnimatedTypeAnimator {
 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&);
index dc7998c..d3be219 100644 (file)
@@ -33,18 +33,18 @@ SVGAnimatedNumberOptionalNumberAnimator::SVGAnimatedNumberOptionalNumberAnimator
 {
 }
 
-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));
 }
index 64734bc..f01cce9 100644 (file)
@@ -31,9 +31,9 @@ class SVGAnimatedNumberOptionalNumberAnimator : public SVGAnimatedTypeAnimator {
 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&);
index 132903b..b210ad9 100644 (file)
@@ -33,14 +33,14 @@ SVGAnimatedPathAnimator::SVGAnimatedPathAnimator(SVGAnimationElement* animationE
 {
 }
 
-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());
@@ -138,7 +138,7 @@ void SVGAnimatedPathAnimator::calculateAnimatedValue(float percentage, unsigned
     if (m_animationElement->isAccumulated() && repeatCount)
         addToSVGPathByteStream(animatedPath, toAtEndOfDurationPath, repeatCount);
 }
-   
+
 float SVGAnimatedPathAnimator::calculateDistance(const String&, const String&)
 {
     // FIXME: Support paced animations.
index ac779da..cd00a5d 100644 (file)
@@ -32,8 +32,8 @@ public:
     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&);
index 3d7afc2..09f858d 100644 (file)
@@ -33,14 +33,14 @@ SVGAnimatedPointListAnimator::SVGAnimatedPointListAnimator(SVGAnimationElement*
 {
 }
 
-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));
 }
index 4c8b185..d5de7e0 100644 (file)
@@ -35,9 +35,9 @@ class SVGAnimatedPointListAnimator : public SVGAnimatedTypeAnimator {
 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&);
index e200688..4e38535 100644 (file)
 #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));
 }
index 5c9b75e..2bf6658 100644 (file)
@@ -42,9 +42,9 @@ class SVGAnimatedPreserveAspectRatioAnimator : public SVGAnimatedTypeAnimator {
 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&);
index 1677a22..96aebc0 100644 (file)
@@ -32,14 +32,14 @@ SVGAnimatedRectAnimator::SVGAnimatedRectAnimator(SVGAnimationElement* animationE
 {
 }
 
-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));
 }
@@ -99,7 +99,7 @@ float SVGAnimatedRectAnimator::calculateDistance(const String&, const String&)
     // FIXME: Distance calculation is not possible for SVGRect right now. We need the distance of for every single value.
     return -1;
 }
-    
+
 }
 
 #endif // ENABLE(SVG)
index 51b947a..2e9bd46 100644 (file)
@@ -44,8 +44,8 @@ public:
     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&);
index 002458b..fbe63fc 100644 (file)
@@ -31,14 +31,14 @@ SVGAnimatedStringAnimator::SVGAnimatedStringAnimator(SVGAnimationElement* animat
 {
 }
 
-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));
 }
index 868bcc5..b78ce07 100644 (file)
@@ -43,8 +43,8 @@ public:
     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;
index 8cbbdb6..8096f5e 100644 (file)
@@ -41,15 +41,15 @@ SVGAnimatedTransformListAnimator::SVGAnimatedTransformListAnimator(SVGAnimationE
     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));
 }
@@ -130,8 +130,8 @@ float SVGAnimatedTransformListAnimator::calculateDistance(const String& fromStri
 
     // 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();
index 3c29092..3749717 100644 (file)
@@ -42,8 +42,8 @@ public:
     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;
index 5a17f1b..ad286e9 100644 (file)
@@ -92,140 +92,140 @@ SVGAnimatedType::~SVGAnimatedType()
     }
 }
 
-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()
index 8ac74a1..10ad025 100644 (file)
@@ -39,25 +39,27 @@ class SVGPathByteStream;
 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; }
@@ -270,10 +272,8 @@ public:
 
     String valueAsString();
     bool setValueAsString(const QualifiedName&, const String&);
-    
-private:
-    SVGAnimatedType(AnimatedPropertyType);
 
+private:
     AnimatedPropertyType m_type;
 
     union DataUnion {
@@ -301,7 +301,7 @@ private:
         SVGTransformList* transformList;
     } m_data;
 };
-    
+
 } // namespace WebCore
 
 #endif // ENABLE(SVG)
index e19b1e1..8519088 100644 (file)
@@ -48,13 +48,13 @@ SVGAnimatedTypeAnimator::SVGAnimatedTypeAnimator(AnimatedPropertyType type, SVGA
 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);
index a4d9a4c..493add0 100644 (file)
@@ -25,7 +25,7 @@
 #include "SVGAnimatedProperty.h"
 #include "SVGAnimatedType.h"
 #include "SVGElementInstance.h"
-#include <wtf/PassOwnPtr.h>
+#include <wtf/StdLibExtras.h>
 
 namespace WebCore {
 
@@ -45,9 +45,9 @@ class SVGAnimatedTypeAnimator {
     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;
@@ -57,8 +57,8 @@ public:
     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; }
index fd9064c..1feced6 100644 (file)
@@ -45,46 +45,46 @@ class SVGAnimationElement;
 
 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;
         }
@@ -95,9 +95,8 @@ public:
 
 private:
     SVGAnimatorFactory() { }
-
 };
-    
+
 } // namespace WebCore
 
 #endif // ENABLE(SVG)
index b141f40..9ca2409 100644 (file)
@@ -44,7 +44,7 @@ namespace WebCore {
 
 SVGDocumentExtensions::SVGDocumentExtensions(Document* document)
     : m_document(document)
-    , m_resourcesCache(adoptPtr(new SVGResourcesCache))
+    , m_resourcesCache(std::make_unique<SVGResourcesCache>())
 {
 }
 
@@ -97,23 +97,23 @@ void SVGDocumentExtensions::startAnimations()
     // 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()
@@ -121,8 +121,8 @@ 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;
@@ -153,9 +153,9 @@ void SVGDocumentExtensions::addPendingResource(const AtomicString& id, Element*
     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();
@@ -176,8 +176,8 @@ bool SVGDocumentExtensions::isElementPendingResources(Element* element) const
 
     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);
 
@@ -210,8 +210,8 @@ void SVGDocumentExtensions::removeElementFromPendingResources(Element* element)
     // 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());
@@ -224,16 +224,16 @@ void SVGDocumentExtensions::removeElementFromPendingResources(Element* element)
         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());
@@ -244,19 +244,19 @@ void SVGDocumentExtensions::removeElementFromPendingResources(Element* element)
         }
 
         // 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);
@@ -269,9 +269,9 @@ void SVGDocumentExtensions::markPendingResourcesForRemoval(const AtomicString& i
 
     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)
@@ -283,7 +283,7 @@ Element* SVGDocumentExtensions::removeElementFromPendingResourcesForRemoval(cons
     if (!resourceSet || resourceSet->isEmpty())
         return 0;
 
-    SVGPendingElements::iterator firstElement = resourceSet->begin();
+    auto firstElement = resourceSet->begin();
     Element* element = *firstElement;
 
     resourceSet->remove(firstElement);
@@ -297,7 +297,7 @@ Element* SVGDocumentExtensions::removeElementFromPendingResourcesForRemoval(cons
 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();
@@ -313,9 +313,9 @@ void SVGDocumentExtensions::addElementReferencingTarget(SVGElement* referencingE
         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)
@@ -331,28 +331,28 @@ void SVGDocumentExtensions::removeAllTargetReferencesForElement(SVGElement* refe
             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))
index 5d0cb23..b3cd4b1 100644 (file)
@@ -25,7 +25,6 @@
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/text/AtomicStringHash.h>
 
 namespace WebCore {
@@ -84,10 +83,10 @@ private:
     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
@@ -99,14 +98,14 @@ public:
     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&);
 };
 
 }
index 58b4694..fc21134 100644 (file)
@@ -30,11 +30,7 @@ class SVGFontFaceElement;
 
 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);
@@ -53,8 +49,6 @@ public:
     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;
 
index ef3ba98..c03698d 100644 (file)
@@ -46,7 +46,7 @@ BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFontElement)
 END_REGISTER_ANIMATED_PROPERTIES
 
 inline SVGFontElement::SVGFontElement(const QualifiedName& tagName, Document& document)
-    : SVGElement(tagName, document) 
+    : SVGElement(tagName, document)
     , m_missingGlyph(0)
     , m_isGlyphCacheValid(false)
 {
@@ -102,7 +102,7 @@ void SVGFontElement::registerLigaturesInGlyphCache(Vector<String>& ligatures)
                 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;
@@ -179,9 +179,9 @@ void SVGKerningMap::insert(const SVGKerningPair& kerningPair)
         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));
         }
     }
 
@@ -191,9 +191,9 @@ void SVGKerningMap::insert(const SVGKerningPair& kerningPair)
         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));
         }
     }
 
@@ -281,7 +281,7 @@ static inline float kerningForPairOfStringsAndGlyphs(const SVGKerningMap& kernin
 
     return 0;
 }
-    
+
 float SVGFontElement::horizontalKerningForPairOfStringsAndGlyphs(const String& u1, const String& g1, const String& u2, const String& g2) const
 {
     if (m_horizontalKerningMap.isEmpty())
@@ -316,7 +316,7 @@ SVGGlyph SVGFontElement::svgGlyphForGlyph(Glyph glyph)
     ensureGlyphCache();
     return m_glyphMap.svgGlyphForGlyph(glyph);
 }
-    
+
 Glyph SVGFontElement::missingGlyph()
 {
     ensureGlyphCache();
index e6c580f..a87b554 100644 (file)
@@ -53,8 +53,8 @@ struct SVGKerningPair : public SVGKerning {
 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(); }
@@ -62,7 +62,7 @@ struct SVGKerningMap {
     void insert(const SVGKerningPair&);
 };
 
-class SVGMissingGlyphElement;    
+class SVGMissingGlyphElement;
 
 class SVGFontElement FINAL : public SVGElement
                            , public SVGExternalResourcesRequired {
index 501e3f1..890dd2a 100644 (file)
@@ -87,7 +87,7 @@ AffineTransform SVGGraphicsElement::animatedLocalTransform() const
 AffineTransform* SVGGraphicsElement::supplementalTransform()
 {
     if (!m_supplementalTransform)
-        m_supplementalTransform = adoptPtr(new AffineTransform);
+        m_supplementalTransform = std::make_unique<AffineTransform>();
     return m_supplementalTransform.get();
 }
 
index aecd6a5..04f547b 100644 (file)
@@ -71,7 +71,7 @@ private:
     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.
index 8927b75..36f91a0 100644 (file)
 #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&);
index 041bf70..65f4bd8 100644 (file)
@@ -27,7 +27,6 @@
 #if ENABLE(SVG)
 #include "SVGPathConsumer.h"
 #include "SVGPathSeg.h"
-#include <wtf/PassOwnPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
index 357248f..79728f0 100644 (file)
 #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&);
index 797aa11..ce1141c 100644 (file)
 
 #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&);
index e86e74a..1c7ce16 100644 (file)
@@ -117,7 +117,7 @@ bool buildPathFromString(const String& d, Path& result)
 
     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();
@@ -133,7 +133,7 @@ bool buildSVGPathByteStreamFromSVGPathSegList(const SVGPathSegList& list, SVGPat
 
     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();
@@ -151,7 +151,7 @@ bool appendSVGPathByteStreamFromSVGPathSeg(PassRefPtr<SVGPathSeg> pathSeg, SVGPa
     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();
@@ -170,7 +170,7 @@ bool buildPathFromByteStream(SVGPathByteStream* stream, Path& result)
 
     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();
@@ -181,11 +181,11 @@ bool buildSVGPathSegListFromByteStream(SVGPathByteStream* stream, SVGPathElement
 {
     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();
@@ -196,11 +196,11 @@ bool buildStringFromByteStream(SVGPathByteStream* stream, String& result, PathPa
 {
     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();
@@ -216,7 +216,7 @@ bool buildStringFromSVGPathSegList(const SVGPathSegList& list, String& result, P
 
     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();
@@ -233,7 +233,7 @@ bool buildSVGPathByteStreamFromString(const String& d, SVGPathByteStream* 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();
@@ -253,8 +253,8 @@ bool buildAnimatedSVGPathByteStream(SVGPathByteStream* fromStream, SVGPathByteSt
 
     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();
@@ -273,8 +273,8 @@ bool addToSVGPathByteStream(SVGPathByteStream* fromStream, SVGPathByteStream* by
     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();
@@ -290,7 +290,7 @@ bool getSVGPathSegAtLengthFromSVGPathByteStream(SVGPathByteStream* stream, float
     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();
@@ -303,11 +303,11 @@ bool getTotalLengthOfSVGPathByteStream(SVGPathByteStream* stream, float& totalLe
     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();
@@ -320,11 +320,11 @@ bool getPointAtLengthOfSVGPathByteStream(SVGPathByteStream* stream, float length
     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();
index e2e667c..7157a98 100644 (file)
@@ -23,7 +23,6 @@
 #if ENABLE(SVG)
 #include "SVGPathConsumer.h"
 #include "SVGPoint.h"
-#include <wtf/OwnPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
index b1983f4..9f3995f 100644 (file)
@@ -71,9 +71,9 @@ void SMILTimeContainer::schedule(SVGSMILElement* animation, SVGElement* target,
 #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);
 
index 29a9512..81d194e 100644 (file)
@@ -88,7 +88,7 @@ private:
 
     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;
index b51403a..50598bb 100644 (file)
@@ -57,7 +57,7 @@ SVGImage::~SVGImage()
 {
     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
     }
 
@@ -346,7 +346,7 @@ bool SVGImage::dataChanged(bool allDataReceived)
     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.
@@ -355,7 +355,7 @@ bool SVGImage::dataChanged(bool allDataReceived)
         // 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);
@@ -379,7 +379,7 @@ bool SVGImage::dataChanged(bool allDataReceived)
         m_intrinsicSize = containerSize();
     }
 
-    return m_page;
+    return m_page != nullptr;
 }
 
 String SVGImage::filenameExtension() const
index 88676ca..c41c943 100644 (file)
@@ -96,8 +96,8 @@ private:
     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;
 };
 
index 9782a6c..3e000d3 100644 (file)
@@ -25,7 +25,6 @@
 #include "Image.h"
 #include "IntSize.h"
 #include <wtf/HashMap.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
@@ -40,13 +39,9 @@ class RenderObject;
 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);
@@ -55,8 +50,6 @@ public:
     Image* imageForRenderer(const RenderObject*);
 
 private:
-    SVGImageCache(SVGImage*);
-
     typedef HashMap<const CachedImageClient*, RefPtr<SVGImageForContainer>> ImageForContainerMap;
 
     SVGImage* m_svgImage;
index 4d5ac02..2c3949b 100644 (file)
@@ -24,7 +24,6 @@
 
 #include "SVGAnimatedProperty.h"
 #include "SVGPropertyInfo.h"
-#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
@@ -54,9 +53,9 @@ void SVGAttributeToPropertyMap::addProperty(const SVGPropertyInfo* info)
         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)
index 4b4f233..0ba2425 100644 (file)
@@ -49,7 +49,7 @@ private:
     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;
 };