Bug 274925 - don't pre-refcount SVG classes directly. r=afri.
This commit is contained in:
Родитель
3879ac8ded
Коммит
386bcfe32d
|
@ -45,8 +45,7 @@
|
|||
// nsSVGCoordCtxHolder implementation
|
||||
|
||||
nsSVGCoordCtxHolder::nsSVGCoordCtxHolder()
|
||||
: mRefCnt(1),
|
||||
mCtxX(dont_AddRef(new nsSVGCoordCtx)),
|
||||
: mCtxX(dont_AddRef(new nsSVGCoordCtx)),
|
||||
mCtxY(dont_AddRef(new nsSVGCoordCtx)),
|
||||
mCtxUnspec(dont_AddRef(new nsSVGCoordCtx))
|
||||
{}
|
||||
|
|
|
@ -98,8 +98,7 @@ class nsSVGCoordCtxProvider : public nsISupports
|
|||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_SVGCOORDCTXPROVIDER_IID)
|
||||
|
||||
nsSVGCoordCtxProvider() :
|
||||
mInner(dont_AddRef(new nsSVGCoordCtxHolder)) {}
|
||||
nsSVGCoordCtxProvider() : mInner(new nsSVGCoordCtxHolder) {}
|
||||
|
||||
already_AddRefed<nsSVGCoordCtx> GetContextX() { return mInner ? mInner->GetContextX() : nsnull; }
|
||||
already_AddRefed<nsSVGCoordCtx> GetContextY() { return mInner ? mInner->GetContextY() : nsnull; }
|
||||
|
|
|
@ -47,7 +47,7 @@ class nsSVGMatrix : public nsIDOMSVGMatrix,
|
|||
public nsSVGValue
|
||||
{
|
||||
public:
|
||||
nsSVGMatrix(float a, float b, float c, float d, float e, float f); // addrefs
|
||||
nsSVGMatrix(float a, float b, float c, float d, float e, float f);
|
||||
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -74,13 +74,13 @@ NS_NewSVGMatrix(nsIDOMSVGMatrix** result,
|
|||
*result = new nsSVGMatrix(a, b, c, d, e, f);
|
||||
if (!*result)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(*result);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsSVGMatrix::nsSVGMatrix(float a, float b, float c,
|
||||
float d, float e, float f)
|
||||
: mRefCnt(1), mA(a), mB(b), mC(c), mD(d), mE(e), mF(f)
|
||||
: mA(a), mB(b), mC(c), mD(d), mE(e), mF(f)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ class nsSVGPoint : public nsIDOMSVGPoint,
|
|||
public nsSVGValue
|
||||
{
|
||||
public:
|
||||
nsSVGPoint(float x, float y); // addrefs
|
||||
nsSVGPoint(float x, float y);
|
||||
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -71,12 +71,12 @@ NS_NewSVGPoint(nsIDOMSVGPoint** result, float x, float y)
|
|||
*result = new nsSVGPoint(x, y);
|
||||
if (!*result)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(*result);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsSVGPoint::nsSVGPoint(float x, float y)
|
||||
: mRefCnt(1), mX(x), mY(y)
|
||||
: mX(x), mY(y)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ class nsSVGRect : public nsIDOMSVGRect,
|
|||
public nsSVGValue
|
||||
{
|
||||
public:
|
||||
nsSVGRect(float x=0.0f, float y=0.0f, float w=0.0f, float h=0.0f); // addrefs
|
||||
nsSVGRect(float x=0.0f, float y=0.0f, float w=0.0f, float h=0.0f);
|
||||
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -73,7 +73,7 @@ protected:
|
|||
// implementation:
|
||||
|
||||
nsSVGRect::nsSVGRect(float x, float y, float w, float h)
|
||||
: mRefCnt(1), mX(x), mY(y), mWidth(w), mHeight(h)
|
||||
: mX(x), mY(y), mWidth(w), mHeight(h)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ class nsSVGViewBox : public nsSVGRect,
|
|||
{
|
||||
public:
|
||||
nsSVGViewBox(nsIDOMSVGLength* viewportWidth,
|
||||
nsIDOMSVGLength* viewportHeight); // addrefs
|
||||
nsIDOMSVGLength* viewportHeight);
|
||||
virtual ~nsSVGViewBox();
|
||||
|
||||
// nsISupports interface:
|
||||
|
@ -252,6 +252,7 @@ nsSVGViewBox::nsSVGViewBox(nsIDOMSVGLength* viewportWidth, nsIDOMSVGLength* view
|
|||
{
|
||||
mViewportWidth->GetValue(&mWidth);
|
||||
mViewportHeight->GetValue(&mHeight);
|
||||
NS_ADDREF(this);
|
||||
NS_ADD_SVGVALUE_OBSERVER(mViewportWidth);
|
||||
NS_ADD_SVGVALUE_OBSERVER(mViewportHeight);
|
||||
}
|
||||
|
@ -354,9 +355,9 @@ nsresult
|
|||
NS_NewSVGRect(nsIDOMSVGRect** result, float x, float y,
|
||||
float width, float height)
|
||||
{
|
||||
*result = new nsSVGRect(x, y, width, height); // ctor addrefs
|
||||
*result = new nsSVGRect(x, y, width, height);
|
||||
if (!*result) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(*result);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -370,7 +371,7 @@ NS_NewSVGViewBox(nsIDOMSVGRect** result,
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
*result = new nsSVGViewBox(viewportWidth, viewportHeight); // ctor addrefs
|
||||
*result = new nsSVGViewBox(viewportWidth, viewportHeight);
|
||||
if (!*result) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
return NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче