Closed Bug 1049075 Opened 10 years ago Closed 10 years ago

remove virtual from methods of nsGridCell

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: tbsaunde, Assigned: dholbert)

Details

Attachments

(1 file)

This class doesn't inherit from anything, so I don't see a good reason for it to have virtual methods.
(To be clear, it looks like this is XUL grid, not CSS grid -- http://mxr.mozilla.org/mozilla-central/source/layout/xul/grid/nsGridCell.h .)

Indeed, this class doesn't inherit, nor does anything inherit from it. So, no point in 'virtual'.

The only virtual method I see is the destructor.  We should also mark the class MOZ_FINAL, to verify that we're actually correct in thinking that nothing inherits from it. (and in the unlikely scenario that anyone adds a child class, they'll have to remove that annotation and hopefully will notice that they should re-virtualize the destructor.)
Trevor, were you intending to take this?  If so, excellent! If not, I may take it or mark it as a mentored bug.
Flags: needinfo?(trev.saunders)
(In reply to Daniel Holbert [:dholbert] from comment #2)
> Trevor, were you intending to take this?  If so, excellent! If not, I may
> take it or mark it as a mentored bug.

nah, was just filing follow ups for bug 1047696, feel free to find someone to fix it.
Flags: needinfo?(trev.saunders)
Flags: needinfo?(dholbert)
(I ended up opting to write the patch myself; I tend to think this isn't substantial enough or exciting enough to make for a particularly good mentored bug.)

3 changes:
 - drop 'virtual' from destructor
 - Add MOZ_FINAL to make sure that dropping 'virtual' is safe
 - Add #include for Attributes.h, which provides MOZ_FINAL
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #8470241 - Flags: review?(tnikkel)
Flags: needinfo?(dholbert)
Attachment #8470241 - Flags: review?(tnikkel) → review+
OS: Linux → All
Hardware: x86_64 → All
Version: unspecified → Trunk
https://hg.mozilla.org/mozilla-central/rev/d8b1d2b3e762
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: