Bug 1029140 - Make the destructor of nsROCSSPrimitiveValue private. r=bz

This commit is contained in:
Andrew McCreight 2014-06-26 09:29:05 -07:00
parent c4c724ffd1
commit 78f144a4d1
3 changed files with 4 additions and 15 deletions

View File

@ -1808,7 +1808,7 @@ nsComputedDOMStyle::GetCSSGradientString(const nsStyleGradient* aGradient,
bool needSep = false;
nsAutoString tokenString;
nsROCSSPrimitiveValue *tmpVal = new nsROCSSPrimitiveValue;
nsRefPtr<nsROCSSPrimitiveValue> tmpVal = new nsROCSSPrimitiveValue;
if (isRadial && !aGradient->mLegacySyntax) {
if (aGradient->mSize != NS_STYLE_GRADIENT_SIZE_EXPLICIT_SIZE) {
@ -1908,7 +1908,6 @@ nsComputedDOMStyle::GetCSSGradientString(const nsStyleGradient* aGradient,
needSep = true;
}
delete tmpVal;
aString.Append(')');
}
@ -5081,11 +5080,10 @@ void
nsComputedDOMStyle::SetCssTextToCoord(nsAString& aCssText,
const nsStyleCoord& aCoord)
{
nsROCSSPrimitiveValue* value = new nsROCSSPrimitiveValue;
nsRefPtr<nsROCSSPrimitiveValue> value = new nsROCSSPrimitiveValue;
bool clampNegativeCalc = true;
SetValueToCoord(value, aCoord, clampNegativeCalc);
value->GetCssText(aCssText);
delete value;
}
CSSValue*

View File

@ -33,8 +33,6 @@ nsROCSSPrimitiveValue::~nsROCSSPrimitiveValue()
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsROCSSPrimitiveValue)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsROCSSPrimitiveValue)
// QueryInterface implementation for nsROCSSPrimitiveValue
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsROCSSPrimitiveValue)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsIDOMCSSPrimitiveValue)

View File

@ -77,7 +77,6 @@ public:
// nsROCSSPrimitiveValue
nsROCSSPrimitiveValue();
~nsROCSSPrimitiveValue();
void SetNumber(float aValue);
void SetNumber(int32_t aValue);
@ -108,6 +107,8 @@ public:
virtual JSObject *WrapObject(JSContext *cx) MOZ_OVERRIDE;
private:
~nsROCSSPrimitiveValue();
uint16_t mType;
union {
@ -123,14 +124,6 @@ private:
} mValue;
};
namespace mozilla {
template<>
struct HasDangerousPublicDestructor<nsROCSSPrimitiveValue>
{
static const bool value = true;
};
}
inline nsROCSSPrimitiveValue *mozilla::dom::CSSValue::AsPrimitiveValue()
{
return CssValueType() == nsIDOMCSSValue::CSS_PRIMITIVE_VALUE ?