Closed Bug 1029137 Opened 10 years ago Closed 10 years ago

Remove dangerous public destructor of nsComputedDOMStyle

Categories

(Core :: Layout, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: bjacob, Assigned: mccr8)

References

Details

Attachments

(1 file)

In bug 1028588 we removed dangerous public destructors of XPCOM-refcounted classes outside of a finite whitelist, see HasDangerousPublicDestructor. Now we are going over the entries in this whitelist.

One of them is: nsComputedDOMStyle
Anuj, does this bug look like something you'd be interested in?
Flags: needinfo?(anujagarwal464)
Where is the destructor called?  Bug 1029157 will at least fix the uses of the public destructor in the nsComputedDOMStyle.cpp itself.  That needs some perf testing.
Depends on: 1029157
I'll just do this.  Sorry Anuj that I keep taking your bugs, I'm just on a big cleanup pass of this style code. :)
Assignee: nobody → continuation
Flags: needinfo?(anujagarwal464)
Comment on attachment 8446042 [details] [diff] [review]
Make the destructor of nsComputedDOMStyle private.

r=me
Attachment #8446042 - Flags: review?(bzbarsky) → review+
Comment on attachment 8446042 [details] [diff] [review]
Make the destructor of nsComputedDOMStyle private.

>+++ b/layout/style/nsComputedDOMStyle.h
>-  virtual ~nsComputedDOMStyle();
[...]
> private:
>+  virtual ~nsComputedDOMStyle();
>+

Incidentally, do we know of any reason this needs to be virtual? (particularly now that we're Pretty Sure that the only thing deleting our instances should be our own ::Release method, which know our exact type.)

(We inherit from nsDOMCSSDeclaration, which has a (empty) virtual destructor, so to de-virtualize, we'd need to remove the annotation there as well.)
> Incidentally, do we know of any reason this needs to be virtual?
Yeah, I noticed that, but I didn't want to unravel that sweater...

https://hg.mozilla.org/integration/mozilla-inbound/rev/5b42688bc9e9
https://hg.mozilla.org/mozilla-central/rev/5b42688bc9e9
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
No longer depends on: 1028588
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: