Title: [160224] trunk/Source/WebCore

Diff

Modified: trunk/Source/WebCore/ChangeLog (160223 => 160224)


--- trunk/Source/WebCore/ChangeLog	2013-12-06 17:28:44 UTC (rev 160223)
+++ trunk/Source/WebCore/ChangeLog	2013-12-06 17:40:29 UTC (rev 160224)
@@ -1,3 +1,13 @@
+2013-12-06  Andreas Kling  <[email protected]>
+
+        Make remaining CSSValue constructors return PassRef.
+        <https://webkit.org/b/125337>
+
+        Tweak the remaining CSSValue create() helpers to return PassRef
+        instead of PassRefPtr in the cases where nullptr is never returned.
+
+        Reviewed by Anders Carlsson.
+
 2013-12-06  Roger Fong  <[email protected]>
 
         Hook into some shader symbol logic following the ANGLE update in r159533.

Modified: trunk/Source/WebCore/css/CSSBorderImageSliceValue.h (160223 => 160224)


--- trunk/Source/WebCore/css/CSSBorderImageSliceValue.h	2013-12-06 17:28:44 UTC (rev 160223)
+++ trunk/Source/WebCore/css/CSSBorderImageSliceValue.h	2013-12-06 17:40:29 UTC (rev 160224)
@@ -36,9 +36,9 @@
 
 class CSSBorderImageSliceValue : public CSSValue {
 public:
-    static PassRefPtr<CSSBorderImageSliceValue> create(PassRefPtr<CSSPrimitiveValue> slices, bool fill)
+    static PassRef<CSSBorderImageSliceValue> create(PassRefPtr<CSSPrimitiveValue> slices, bool fill)
     {
-        return adoptRef(new CSSBorderImageSliceValue(slices, fill));
+        return adoptRef(*new CSSBorderImageSliceValue(slices, fill));
     }
 
     String customCSSText() const;

Modified: trunk/Source/WebCore/css/CSSCalculationValue.cpp (160223 => 160224)


--- trunk/Source/WebCore/css/CSSCalculationValue.cpp	2013-12-06 17:28:44 UTC (rev 160223)
+++ trunk/Source/WebCore/css/CSSCalculationValue.cpp	2013-12-06 17:40:29 UTC (rev 160224)
@@ -750,9 +750,9 @@
     return _expression_ ? adoptRef(new CSSCalcValue(_expression_, range)) : 0;
 }
 
-PassRefPtr<CSSCalcValue> CSSCalcValue::create(PassRefPtr<CSSCalcExpressionNode> _expression_, CalculationPermittedValueRange range)
+PassRef<CSSCalcValue> CSSCalcValue::create(PassRefPtr<CSSCalcExpressionNode> _expression_, CalculationPermittedValueRange range)
 {
-    return adoptRef(new CSSCalcValue(_expression_, range));
+    return adoptRef(*new CSSCalcValue(_expression_, range));
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/css/CSSCalculationValue.h (160223 => 160224)


--- trunk/Source/WebCore/css/CSSCalculationValue.h	2013-12-06 17:28:44 UTC (rev 160223)
+++ trunk/Source/WebCore/css/CSSCalculationValue.h	2013-12-06 17:40:29 UTC (rev 160224)
@@ -91,8 +91,8 @@
 class CSSCalcValue : public CSSValue {
 public:
     static PassRefPtr<CSSCalcValue> create(CSSParserString name, CSSParserValueList*, CalculationPermittedValueRange);
-    static PassRefPtr<CSSCalcValue> create(PassRefPtr<CSSCalcExpressionNode>, CalculationPermittedValueRange = CalculationRangeAll);
-    static PassRefPtr<CSSCalcValue> create(const CalculationValue* value, const RenderStyle* style) { return adoptRef(new CSSCalcValue(value, style)); }
+    static PassRef<CSSCalcValue> create(PassRefPtr<CSSCalcExpressionNode>, CalculationPermittedValueRange = CalculationRangeAll);
+    static PassRef<CSSCalcValue> create(const CalculationValue* value, const RenderStyle* style) { return adoptRef(*new CSSCalcValue(value, style)); }
 
     static PassRefPtr<CSSCalcExpressionNode> createExpressionNode(PassRefPtr<CSSPrimitiveValue>, bool isInteger = false);
     static PassRefPtr<CSSCalcExpressionNode> createExpressionNode(PassRefPtr<CSSCalcExpressionNode>, PassRefPtr<CSSCalcExpressionNode>, CalcOperator);

Modified: trunk/Source/WebCore/css/CSSCrossfadeValue.h (160223 => 160224)


--- trunk/Source/WebCore/css/CSSCrossfadeValue.h	2013-12-06 17:28:44 UTC (rev 160223)
+++ trunk/Source/WebCore/css/CSSCrossfadeValue.h	2013-12-06 17:40:29 UTC (rev 160224)
@@ -43,9 +43,9 @@
 class CSSCrossfadeValue : public CSSImageGeneratorValue {
     friend class CrossfadeSubimageObserverProxy;
 public:
-    static PassRefPtr<CSSCrossfadeValue> create(PassRefPtr<CSSValue> fromValue, PassRefPtr<CSSValue> toValue)
+    static PassRef<CSSCrossfadeValue> create(PassRefPtr<CSSValue> fromValue, PassRefPtr<CSSValue> toValue)
     {
-        return adoptRef(new CSSCrossfadeValue(fromValue, toValue));
+        return adoptRef(*new CSSCrossfadeValue(fromValue, toValue));
     }
 
     ~CSSCrossfadeValue();

Modified: trunk/Source/WebCore/css/CSSFilterImageValue.h (160223 => 160224)


--- trunk/Source/WebCore/css/CSSFilterImageValue.h	2013-12-06 17:28:44 UTC (rev 160223)
+++ trunk/Source/WebCore/css/CSSFilterImageValue.h	2013-12-06 17:40:29 UTC (rev 160224)
@@ -48,9 +48,9 @@
 class CSSFilterImageValue : public CSSImageGeneratorValue {
     friend class FilterSubimageObserverProxy;
 public:
-    static PassRefPtr<CSSFilterImageValue> create(PassRefPtr<CSSValue> imageValue, PassRefPtr<CSSValue> filterValue)
+    static PassRef<CSSFilterImageValue> create(PassRefPtr<CSSValue> imageValue, PassRefPtr<CSSValue> filterValue)
     {
-        return adoptRef(new CSSFilterImageValue(imageValue, filterValue));
+        return adoptRef(*new CSSFilterImageValue(imageValue, filterValue));
     }
 
     ~CSSFilterImageValue();

Modified: trunk/Source/WebCore/css/CSSGradientValue.h (160223 => 160224)


--- trunk/Source/WebCore/css/CSSGradientValue.h	2013-12-06 17:28:44 UTC (rev 160223)
+++ trunk/Source/WebCore/css/CSSGradientValue.h	2013-12-06 17:40:29 UTC (rev 160224)
@@ -135,9 +135,9 @@
 class CSSLinearGradientValue : public CSSGradientValue {
 public:
 
-    static PassRefPtr<CSSLinearGradientValue> create(CSSGradientRepeat repeat, CSSGradientType gradientType = CSSLinearGradient)
+    static PassRef<CSSLinearGradientValue> create(CSSGradientRepeat repeat, CSSGradientType gradientType = CSSLinearGradient)
     {
-        return adoptRef(new CSSLinearGradientValue(repeat, gradientType));
+        return adoptRef(*new CSSLinearGradientValue(repeat, gradientType));
     }
 
     void setAngle(PassRefPtr<CSSPrimitiveValue> val) { m_angle = val; }
@@ -147,9 +147,9 @@
     // Create the gradient for a given size.
     PassRefPtr<Gradient> createGradient(RenderElement*, const IntSize&);
 
-    PassRefPtr<CSSLinearGradientValue> clone() const
+    PassRef<CSSLinearGradientValue> clone() const
     {
-        return adoptRef(new CSSLinearGradientValue(*this));
+        return adoptRef(*new CSSLinearGradientValue(*this));
     }
 
     bool equals(const CSSLinearGradientValue&) const;
@@ -173,14 +173,14 @@
 
 class CSSRadialGradientValue : public CSSGradientValue {
 public:
-    static PassRefPtr<CSSRadialGradientValue> create(CSSGradientRepeat repeat, CSSGradientType gradientType = CSSRadialGradient)
+    static PassRef<CSSRadialGradientValue> create(CSSGradientRepeat repeat, CSSGradientType gradientType = CSSRadialGradient)
     {
-        return adoptRef(new CSSRadialGradientValue(repeat, gradientType));
+        return adoptRef(*new CSSRadialGradientValue(repeat, gradientType));
     }
 
-    PassRefPtr<CSSRadialGradientValue> clone() const
+    PassRef<CSSRadialGradientValue> clone() const
     {
-        return adoptRef(new CSSRadialGradientValue(*this));
+        return adoptRef(*new CSSRadialGradientValue(*this));
     }
 
     String customCSSText() const;

Modified: trunk/Source/WebCore/css/CSSGridTemplateValue.h (160223 => 160224)


--- trunk/Source/WebCore/css/CSSGridTemplateValue.h	2013-12-06 17:28:44 UTC (rev 160223)
+++ trunk/Source/WebCore/css/CSSGridTemplateValue.h	2013-12-06 17:40:29 UTC (rev 160224)
@@ -39,7 +39,11 @@
 
 class CSSGridTemplateValue : public CSSValue {
 public:
-    static PassRefPtr<CSSGridTemplateValue> create(const NamedGridAreaMap& gridAreaMap, size_t rowCount, size_t columnCount) { return adoptRef(new CSSGridTemplateValue(gridAreaMap, rowCount, columnCount)); }
+    static PassRef<CSSGridTemplateValue> create(const NamedGridAreaMap& gridAreaMap, size_t rowCount, size_t columnCount)
+    {
+        return adoptRef(*new CSSGridTemplateValue(gridAreaMap, rowCount, columnCount));
+    }
+
     ~CSSGridTemplateValue() { }
 
     String customCSSText() const;

Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (160223 => 160224)


--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp	2013-12-06 17:28:44 UTC (rev 160223)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp	2013-12-06 17:40:29 UTC (rev 160224)
@@ -303,9 +303,11 @@
         m_primitiveUnitType = CSS_PX;
         m_value.num = adjustFloatForAbsoluteZoom(length.value(), style);
         return;
-    case Calculated:
-        init(CSSCalcValue::create(length.calculationValue().get(), style));
+    case Calculated: {
+        RefPtr<CSSCalcValue> calcValue = CSSCalcValue::create(length.calculationValue().get(), style);
+        init(calcValue.release());
         return;
+    }
     case Relative:
     case Undefined:
         ASSERT_NOT_REACHED();

Modified: trunk/Source/WebCore/css/CSSTimingFunctionValue.h (160223 => 160224)


--- trunk/Source/WebCore/css/CSSTimingFunctionValue.h	2013-12-06 17:28:44 UTC (rev 160223)
+++ trunk/Source/WebCore/css/CSSTimingFunctionValue.h	2013-12-06 17:40:29 UTC (rev 160224)
@@ -33,9 +33,9 @@
 
 class CSSCubicBezierTimingFunctionValue : public CSSValue {
 public:
-    static PassRefPtr<CSSCubicBezierTimingFunctionValue> create(double x1, double y1, double x2, double y2)
+    static PassRef<CSSCubicBezierTimingFunctionValue> create(double x1, double y1, double x2, double y2)
     {
-        return adoptRef(new CSSCubicBezierTimingFunctionValue(x1, y1, x2, y2));
+        return adoptRef(*new CSSCubicBezierTimingFunctionValue(x1, y1, x2, y2));
     }
 
     String customCSSText() const;
@@ -67,9 +67,9 @@
 
 class CSSStepsTimingFunctionValue : public CSSValue {
 public:
-    static PassRefPtr<CSSStepsTimingFunctionValue> create(int steps, bool stepAtStart)
+    static PassRef<CSSStepsTimingFunctionValue> create(int steps, bool stepAtStart)
     {
-        return adoptRef(new CSSStepsTimingFunctionValue(steps, stepAtStart));
+        return adoptRef(*new CSSStepsTimingFunctionValue(steps, stepAtStart));
     }
 
     int numberOfSteps() const { return m_steps; }

Modified: trunk/Source/WebCore/css/CSSValue.cpp (160223 => 160224)


--- trunk/Source/WebCore/css/CSSValue.cpp	2013-12-06 17:28:44 UTC (rev 160223)
+++ trunk/Source/WebCore/css/CSSValue.cpp	2013-12-06 17:40:29 UTC (rev 160224)
@@ -76,7 +76,10 @@
 
 class TextCloneCSSValue : public CSSValue {
 public:
-    static PassRefPtr<TextCloneCSSValue> create(ClassType classType, const String& text) { return adoptRef(new TextCloneCSSValue(classType, text)); }
+    static PassRef<TextCloneCSSValue> create(ClassType classType, const String& text)
+    {
+        return adoptRef(*new TextCloneCSSValue(classType, text));
+    }
 
     String cssText() const { return m_cssText; }
 

Modified: trunk/Source/WebCore/css/WebKitCSSSVGDocumentValue.h (160223 => 160224)


--- trunk/Source/WebCore/css/WebKitCSSSVGDocumentValue.h	2013-12-06 17:28:44 UTC (rev 160223)
+++ trunk/Source/WebCore/css/WebKitCSSSVGDocumentValue.h	2013-12-06 17:40:29 UTC (rev 160224)
@@ -35,7 +35,10 @@
 
 class WebKitCSSSVGDocumentValue : public CSSValue {
 public:
-    static PassRefPtr<WebKitCSSSVGDocumentValue> create(const String& url) { return adoptRef(new WebKitCSSSVGDocumentValue(url)); }
+    static PassRef<WebKitCSSSVGDocumentValue> create(const String& url)
+    {
+        return adoptRef(*new WebKitCSSSVGDocumentValue(url));
+    }
     ~WebKitCSSSVGDocumentValue();
 
     CachedSVGDocument* cachedSVGDocument() const { return m_document.get(); }

Modified: trunk/Source/WebCore/svg/SVGColor.h (160223 => 160224)


--- trunk/Source/WebCore/svg/SVGColor.h	2013-12-06 17:28:44 UTC (rev 160223)
+++ trunk/Source/WebCore/svg/SVGColor.h	2013-12-06 17:40:29 UTC (rev 160224)
@@ -40,23 +40,23 @@
         SVG_COLORTYPE_CURRENTCOLOR = 3
     };
 
-    static PassRefPtr<SVGColor> createFromString(const String& rgbColor)
+    static PassRef<SVGColor> createFromString(const String& rgbColor)
     {
-        RefPtr<SVGColor> color = adoptRef(new SVGColor(SVG_COLORTYPE_RGBCOLOR));
-        color->setColor(colorFromRGBColorString(rgbColor));
-        return color.release();
+        auto color = adoptRef(*new SVGColor(SVG_COLORTYPE_RGBCOLOR));
+        color.get().setColor(colorFromRGBColorString(rgbColor));
+        return color;
     }
 
-    static PassRefPtr<SVGColor> createFromColor(const Color& rgbColor)
+    static PassRef<SVGColor> createFromColor(const Color& rgbColor)
     {
-        RefPtr<SVGColor> color = adoptRef(new SVGColor(SVG_COLORTYPE_RGBCOLOR));
-        color->setColor(rgbColor);
-        return color.release();
+        auto color = adoptRef(*new SVGColor(SVG_COLORTYPE_RGBCOLOR));
+        color.get().setColor(rgbColor);
+        return color;
     }
 
-    static PassRefPtr<SVGColor> createCurrentColor()
+    static PassRef<SVGColor> createCurrentColor()
     {
-        return adoptRef(new SVGColor(SVG_COLORTYPE_CURRENTCOLOR));
+        return adoptRef(*new SVGColor(SVG_COLORTYPE_CURRENTCOLOR));
     }
 
     const Color& color() const { return m_color; }

Modified: trunk/Source/WebCore/svg/SVGPaint.h (160223 => 160224)


--- trunk/Source/WebCore/svg/SVGPaint.h	2013-12-06 17:28:44 UTC (rev 160223)
+++ trunk/Source/WebCore/svg/SVGPaint.h	2013-12-06 17:40:29 UTC (rev 160224)
@@ -44,45 +44,43 @@
         SVG_PAINTTYPE_URI = 107
     };
 
-    static PassRefPtr<SVGPaint> createUnknown()
+    static PassRef<SVGPaint> createUnknown()
     {
-        return adoptRef(new SVGPaint(SVG_PAINTTYPE_UNKNOWN));
+        return adoptRef(*new SVGPaint(SVG_PAINTTYPE_UNKNOWN));
     }
 
-    static PassRefPtr<SVGPaint> createNone()
+    static PassRef<SVGPaint> createNone()
     {
-        return adoptRef(new SVGPaint(SVG_PAINTTYPE_NONE));
+        return adoptRef(*new SVGPaint(SVG_PAINTTYPE_NONE));
     }
 
-    static PassRefPtr<SVGPaint> createCurrentColor()
+    static PassRef<SVGPaint> createCurrentColor()
     {
-        return adoptRef(new SVGPaint(SVG_PAINTTYPE_CURRENTCOLOR));
+        return adoptRef(*new SVGPaint(SVG_PAINTTYPE_CURRENTCOLOR));
     }
 
-    static PassRefPtr<SVGPaint> createColor(const Color& color)
+    static PassRef<SVGPaint> createColor(const Color& color)
     {
-        RefPtr<SVGPaint> paint = adoptRef(new SVGPaint(SVG_PAINTTYPE_RGBCOLOR));
-        paint->setColor(color);
-        return paint.release();
+        auto paint = adoptRef(*new SVGPaint(SVG_PAINTTYPE_RGBCOLOR));
+        paint.get().setColor(color);
+        return paint;
     }
 
-    static PassRefPtr<SVGPaint> createURI(const String& uri)
+    static PassRef<SVGPaint> createURI(const String& uri)
     {
-        RefPtr<SVGPaint> paint = adoptRef(new SVGPaint(SVG_PAINTTYPE_URI, uri));
-        return paint.release();
+        return adoptRef(*new SVGPaint(SVG_PAINTTYPE_URI, uri));
     }
 
-    static PassRefPtr<SVGPaint> createURIAndColor(const String& uri, const Color& color)
+    static PassRef<SVGPaint> createURIAndColor(const String& uri, const Color& color)
     {
-        RefPtr<SVGPaint> paint = adoptRef(new SVGPaint(SVG_PAINTTYPE_URI_RGBCOLOR, uri));
-        paint->setColor(color);
-        return paint.release();
+        auto paint = adoptRef(*new SVGPaint(SVG_PAINTTYPE_URI_RGBCOLOR, uri));
+        paint.get().setColor(color);
+        return paint;
     }
 
-    static PassRefPtr<SVGPaint> createURIAndNone(const String& uri)
+    static PassRef<SVGPaint> createURIAndNone(const String& uri)
     {
-        RefPtr<SVGPaint> paint = adoptRef(new SVGPaint(SVG_PAINTTYPE_URI_NONE, uri));
-        return paint.release();
+        return adoptRef(*new SVGPaint(SVG_PAINTTYPE_URI_NONE, uri));
     }
 
     const SVGPaintType& paintType() const { return m_paintType; }
@@ -100,11 +98,11 @@
 private:
     friend class ComputedStyleExtractor;
 
-    static PassRefPtr<SVGPaint> create(const SVGPaintType& type, const String& uri, const Color& color)
+    static PassRef<SVGPaint> create(const SVGPaintType& type, const String& uri, const Color& color)
     {
-        RefPtr<SVGPaint> paint = adoptRef(new SVGPaint(type, uri));
-        paint->setColor(color);
-        return paint.release();
+        auto paint = adoptRef(*new SVGPaint(type, uri));
+        paint.get().setColor(color);
+        return paint;
     }
 
 private:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to