Remove bogus 'const' from nsViewManager::CreateView()'s "const nsView* aParent" parameter

RESOLVED FIXED in mozilla22

Status

()

Core
Layout
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

Trunk
mozilla22
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
nsViewManager::CreateView() takes a parameter "const nsView* aParent", which it proceeds to const_cast to a nsView*.  So the constness is a bit of a sham there.

Meanwhile, based on a quick sampling of its callers, it seems that it generally gets passed a "nsView*" -- so there doesn't seem to be any need for the parameter to be const.

Filing this bug on making that parameter just a normal "nsView*", assuming I'm not missing any trouble that that'd cause.

Marking dependency on Bug 848218, since this touches the same code that that patch touches, and I think the patch here should land after Bug 848218 so as not to bitrot it.
(Assignee)

Comment 1

5 years ago
Created attachment 726967 [details] [diff] [review]
fix

This builds locally for me, so I think it's valid.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #726967 - Flags: review?(bzbarsky)
(Assignee)

Comment 2

5 years ago
and by Bug 848218 in comment 0, I of course meant bug 852428. (I copypasted the wrong bug number from the top of an attachment page on that bug.)
Depends on: 852428
No longer depends on: 848218
(Assignee)

Comment 3

5 years ago
Created attachment 726970 [details] [diff] [review]
fix (layered on top of bug 852428's patches)

Here's the patch again, bitrot-fixed to layer on top of bug 852428's patches (since I don't intend to land this until after bug 852428 lands).
Attachment #726967 - Attachment is obsolete: true
Attachment #726967 - Flags: review?(bzbarsky)
Attachment #726970 - Flags: review?(bzbarsky)
Comment on attachment 726970 [details] [diff] [review]
fix (layered on top of bug 852428's patches)

r=me
Attachment #726970 - Flags: review?(bzbarsky) → review+

Comment 6

5 years ago
https://hg.mozilla.org/mozilla-central/rev/4dbe9d169f86
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.