Bug 1448712: Make the ComputedStyle destructor protected. r=xidorn

MozReview-Commit-ID: 49YOyLIJHcG
This commit is contained in:
Emilio Cobos Álvarez 2018-03-25 23:50:35 +02:00
parent ebe845c3c9
commit 2af3d6a81d

View File

@ -31,6 +31,7 @@ class ComputedStyle;
extern "C" {
void Servo_ComputedStyle_AddRef(const mozilla::ComputedStyle* aStyle);
void Servo_ComputedStyle_Release(const mozilla::ComputedStyle* aStyle);
void Gecko_ComputedStyle_Destroy(mozilla::ComputedStyle*);
}
MOZ_DEFINE_MALLOC_ENCLOSING_SIZE_OF(ServoComputedValuesMallocEnclosingSizeOf)
@ -370,10 +371,12 @@ public:
mCachedInheritingStyles.AddSizeOfIncludingThis(aSizes, aCVsSize);
}
// Needs to be public so that we can call it from Servo.
~ComputedStyle() = default;
protected:
// Needs to be friend so that it can call the destructor without making it
// public.
friend void ::Gecko_ComputedStyle_Destroy(ComputedStyle*);
~ComputedStyle() = default;
nsPresContext* mPresContext;