Bug 1125647 - make SVGAnimatedPreserveAspectRatio::ToDOMAnimatedPreserveAspectRatio just return the value. r=dholbert
authorRobert Longson <longsonr@gmail.com>
Tue, 27 Jan 2015 09:51:34 +0000
changeset 225958 99a9da54c236ba93fbeb13a57ba3c932f4a67450
parent 225957 0767ae5882f9f54387ee846afbd06e5b51858525
child 225959 5692ab04fdc1eacd74af5f0b0f88e8390a1a5eeb
push id54714
push userlongsonr@gmail.com
push dateTue, 27 Jan 2015 09:51:44 +0000
treeherdermozilla-inbound@99a9da54c236 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1125647
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1125647 - make SVGAnimatedPreserveAspectRatio::ToDOMAnimatedPreserveAspectRatio just return the value. r=dholbert
dom/svg/SVGAnimatedPreserveAspectRatio.cpp
dom/svg/SVGAnimatedPreserveAspectRatio.h
dom/svg/SVGFEImageElement.cpp
dom/svg/SVGIFrameElement.cpp
dom/svg/SVGImageElement.cpp
dom/svg/SVGMarkerElement.cpp
dom/svg/SVGPatternElement.cpp
dom/svg/SVGSVGElement.cpp
dom/svg/SVGSymbolElement.cpp
dom/svg/SVGViewElement.cpp
--- a/dom/svg/SVGAnimatedPreserveAspectRatio.cpp
+++ b/dom/svg/SVGAnimatedPreserveAspectRatio.cpp
@@ -272,29 +272,27 @@ SVGAnimatedPreserveAspectRatio::SetAnimV
   }
   mAnimVal.SetDefer(((aPackedValue & 0xff0000) >> 16) ? true : false);
   mAnimVal.SetAlign(uint16_t((aPackedValue & 0xff00) >> 8));
   mAnimVal.SetMeetOrSlice(uint16_t(aPackedValue & 0xff));
   mIsAnimated = true;
   aSVGElement->DidAnimatePreserveAspectRatio();
 }
 
-nsresult
+already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
 SVGAnimatedPreserveAspectRatio::ToDOMAnimatedPreserveAspectRatio(
-  DOMSVGAnimatedPreserveAspectRatio **aResult,
   nsSVGElement *aSVGElement)
 {
   nsRefPtr<DOMSVGAnimatedPreserveAspectRatio> domAnimatedPAspectRatio =
     sSVGAnimatedPAspectRatioTearoffTable.GetTearoff(this);
   if (!domAnimatedPAspectRatio) {
     domAnimatedPAspectRatio = new DOMSVGAnimatedPreserveAspectRatio(this, aSVGElement);
     sSVGAnimatedPAspectRatioTearoffTable.AddTearoff(this, domAnimatedPAspectRatio);
   }
-  domAnimatedPAspectRatio.forget(aResult);
-  return NS_OK;
+  return domAnimatedPAspectRatio.forget();
 }
 
 DOMSVGAnimatedPreserveAspectRatio::~DOMSVGAnimatedPreserveAspectRatio()
 {
   sSVGAnimatedPAspectRatioTearoffTable.RemoveTearoff(mVal);
 }
 
 nsISMILAttr*
--- a/dom/svg/SVGAnimatedPreserveAspectRatio.h
+++ b/dom/svg/SVGAnimatedPreserveAspectRatio.h
@@ -68,19 +68,18 @@ public:
     { return mBaseVal; }
   const SVGPreserveAspectRatio &GetAnimValue() const
     { return mAnimVal; }
   bool IsAnimated() const
     { return mIsAnimated; }
   bool IsExplicitlySet() const
     { return mIsAnimated || mIsBaseSet; }
 
-  nsresult ToDOMAnimatedPreserveAspectRatio(
-    mozilla::dom::DOMSVGAnimatedPreserveAspectRatio **aResult,
-    nsSVGElement* aSVGElement);
+  already_AddRefed<mozilla::dom::DOMSVGAnimatedPreserveAspectRatio>
+  ToDOMAnimatedPreserveAspectRatio(nsSVGElement* aSVGElement);
   // Returns a new nsISMILAttr object that the caller must delete
   nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement);
 
 private:
 
   SVGPreserveAspectRatio mAnimVal;
   SVGPreserveAspectRatio mBaseVal;
   bool mIsAnimated;
--- a/dom/svg/SVGFEImageElement.cpp
+++ b/dom/svg/SVGFEImageElement.cpp
@@ -301,19 +301,17 @@ SVGFEImageElement::OutputIsTainted(const
 }
 
 //----------------------------------------------------------------------
 // nsSVGElement methods
 
 already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
 SVGFEImageElement::PreserveAspectRatio()
 {
-  nsRefPtr<DOMSVGAnimatedPreserveAspectRatio> ratio;
-  mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(getter_AddRefs(ratio), this);
-  return ratio.forget();
+  return mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(this);
 }
 
 SVGAnimatedPreserveAspectRatio *
 SVGFEImageElement::GetPreserveAspectRatio()
 {
   return &mPreserveAspectRatio;
 }
 
--- a/dom/svg/SVGIFrameElement.cpp
+++ b/dom/svg/SVGIFrameElement.cpp
@@ -144,20 +144,17 @@ already_AddRefed<SVGAnimatedLength>
 SVGIFrameElement::Height()
 {
   return mLengthAttributes[ATTR_HEIGHT].ToDOMAnimatedLength(this);
 }
 
 already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
 SVGIFrameElement::PreserveAspectRatio()
 {
-  nsRefPtr<DOMSVGAnimatedPreserveAspectRatio> ratio;
-  mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(getter_AddRefs(ratio),
-                                                        this);
-  return ratio.forget();
+  return mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(this);
 }
 
 void
 SVGIFrameElement::GetName(DOMString& name)
 {
   GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
 }
 
--- a/dom/svg/SVGImageElement.cpp
+++ b/dom/svg/SVGImageElement.cpp
@@ -96,19 +96,17 @@ already_AddRefed<SVGAnimatedLength>
 SVGImageElement::Height()
 {
   return mLengthAttributes[ATTR_HEIGHT].ToDOMAnimatedLength(this);
 }
 
 already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
 SVGImageElement::PreserveAspectRatio()
 {
-  nsRefPtr<DOMSVGAnimatedPreserveAspectRatio> ratio;
-  mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(getter_AddRefs(ratio), this);
-  return ratio.forget();
+  return mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(this);
 }
 
 already_AddRefed<SVGAnimatedString>
 SVGImageElement::Href()
 {
   return mStringAttributes[HREF].ToDOMAnimatedString(this);
 }
 
--- a/dom/svg/SVGMarkerElement.cpp
+++ b/dom/svg/SVGMarkerElement.cpp
@@ -110,19 +110,17 @@ already_AddRefed<SVGAnimatedRect>
 SVGMarkerElement::ViewBox()
 {
   return mViewBox.ToSVGAnimatedRect(this);
 }
 
 already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
 SVGMarkerElement::PreserveAspectRatio()
 {
-  nsRefPtr<DOMSVGAnimatedPreserveAspectRatio> ratio;
-  mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(getter_AddRefs(ratio), this);
-  return ratio.forget();
+  return mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(this);
 }
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedLength>
 SVGMarkerElement::RefX()
 {
   return mLengthAttributes[REFX].ToDOMAnimatedLength(this);
--- a/dom/svg/SVGPatternElement.cpp
+++ b/dom/svg/SVGPatternElement.cpp
@@ -68,19 +68,17 @@ already_AddRefed<SVGAnimatedRect>
 SVGPatternElement::ViewBox()
 {
   return mViewBox.ToSVGAnimatedRect(this);
 }
 
 already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
 SVGPatternElement::PreserveAspectRatio()
 {
-  nsRefPtr<DOMSVGAnimatedPreserveAspectRatio> ratio;
-  mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(getter_AddRefs(ratio), this);
-  return ratio.forget();
+  return mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(this);
 }
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedEnumeration>
 SVGPatternElement::PatternUnits()
 {
   return mEnumAttributes[PATTERNUNITS].ToDOMAnimatedEnum(this);
--- a/dom/svg/SVGSVGElement.cpp
+++ b/dom/svg/SVGSVGElement.cpp
@@ -442,19 +442,17 @@ already_AddRefed<SVGAnimatedRect>
 SVGSVGElement::ViewBox()
 {
   return mViewBox.ToSVGAnimatedRect(this);
 }
 
 already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
 SVGSVGElement::PreserveAspectRatio()
 {
-  nsRefPtr<DOMSVGAnimatedPreserveAspectRatio> ratio;
-  mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(getter_AddRefs(ratio), this);
-  return ratio.forget();
+  return mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(this);
 }
 
 uint16_t
 SVGSVGElement::ZoomAndPan()
 {
   SVGViewElement* viewElement = GetCurrentViewElement();
   if (viewElement && viewElement->mEnumAttributes[
                        SVGViewElement::ZOOMANDPAN].IsExplicitlySet()) {
--- a/dom/svg/SVGSymbolElement.cpp
+++ b/dom/svg/SVGSymbolElement.cpp
@@ -47,19 +47,17 @@ already_AddRefed<SVGAnimatedRect>
 SVGSymbolElement::ViewBox()
 {
   return mViewBox.ToSVGAnimatedRect(this);
 }
 
 already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
 SVGSymbolElement::PreserveAspectRatio()
 {
-  nsRefPtr<DOMSVGAnimatedPreserveAspectRatio> ratio;
-  mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(getter_AddRefs(ratio), this);
-  return ratio.forget();
+  return mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(this);
 }
 
 //----------------------------------------------------------------------
 // nsIContent methods
 
 NS_IMETHODIMP_(bool)
 SVGSymbolElement::IsAttributeMapped(const nsIAtom* name) const
 {
--- a/dom/svg/SVGViewElement.cpp
+++ b/dom/svg/SVGViewElement.cpp
@@ -68,19 +68,17 @@ already_AddRefed<SVGAnimatedRect>
 SVGViewElement::ViewBox()
 {
   return mViewBox.ToSVGAnimatedRect(this);
 }
 
 already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
 SVGViewElement::PreserveAspectRatio()
 {
-  nsRefPtr<DOMSVGAnimatedPreserveAspectRatio> ratio;
-  mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(getter_AddRefs(ratio), this);
-  return ratio.forget();
+  return mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(this);
 }
 
 //----------------------------------------------------------------------
 
 already_AddRefed<DOMSVGStringList>
 SVGViewElement::ViewTarget()
 {
   return DOMSVGStringList::GetDOMWrapper(