Closed
Bug 1034922
Opened 10 years ago
Closed 9 years ago
Remove dangerous public destructor of nsSiteWindow
Categories
(Core :: XUL, defect)
Tracking
()
RESOLVED
FIXED
mozilla42
Tracking | Status | |
---|---|---|
firefox42 | --- | fixed |
People
(Reporter: bjacob, Assigned: nika)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
enndeakin
:
review+
|
Details | Diff | Splinter Review |
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: nsSiteWindow
Comment 1•10 years ago
|
||
nsSiteWindow is only used in one place as a helper because of clashing method names I think. For some reason, it's manually deleted in the parent class nsContentTreeOwner.
Reporter | ||
Comment 3•10 years ago
|
||
For sure!
Attachment #8465757 -
Flags: review?(hyatt)
Comment 5•10 years ago
|
||
Comment on attachment 8465757 [details] [diff] [review]
Bug 1034922 - Remove Dangerous Public Destructor nsSiteWindow
This seems to just remove the object. I don't think that's what we want to do.
Attachment #8465757 -
Flags: review?(hyatt) → review-
I have to turn nsSiteWindow *mSiteWindow[1] into a nsRefPtr<> right?
[1]http://mxr.mozilla.org/mozilla-central/source/xpfe/appshell/src/nsContentTreeOwner.h#54
If I do that it gives me the following errors:
2143: syntax error : missing ';' before '<'
2:26.76 c:\mozilla-central\xpfe\appshell\src\nsContentTreeOwner.h(54) : error C
4430: missing type specifier - int assumed. Note: C++ does not support default-i
nt
2:26.77 c:\mozilla-central\xpfe\appshell\src\nsContentTreeOwner.h(54) : error C
2238: unexpected token(s) preceding ';'
2:26.77 c:\mozilla-central\xpfe\appshell\src\nsContentTreeOwner.cpp(79) : error
C2065: 'mSiteWindow' : undeclared identifier
2:26.77 c:\mozilla-central\xpfe\appshell\src\nsContentTreeOwner.cpp(84) : error
C2065: 'mSiteWindow' : undeclared identifier
2:26.78 c:\mozilla-central\xpfe\appshell\src\nsContentTreeOwner.cpp(84) : error
C2541: 'delete' : cannot delete objects that are not pointers
2:26.78 c:\mozilla-central\xpfe\appshell\src\nsContentTreeOwner.cpp(111) : error C2065: 'mSiteWindow' : undeclared identifier
Can someone tell me how should I remove these errors?
Comment 7•10 years ago
|
||
You probably need to include nsAutoPtr.h in the header. Does that help? Sorry nobody got back to you earlier.
Hi Anuj,
Yes I'm working on this bug. I apologize for taking so much time, but I'll submit a patch for this one soon. Could you take up some other bug?
Flags: needinfo?(rimjhim.mazumder17)
Comment 10•10 years ago
|
||
Hi, Debkanya - Are you still working on this?
Assignee | ||
Comment 11•9 years ago
|
||
This doesn't seem to have had work done on it in a while, so here's a simple patch to get rid of the need for HasDangerousPublicDestructor.
Attachment #8465757 -
Attachment is obsolete: true
Attachment #8630820 -
Flags: review?(enndeakin)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → michael
Assignee | ||
Comment 12•9 years ago
|
||
This updated patch changes the NS_DECL_ISUPPORTS to NS_DECL_ISUPPORTS_INHERITED, to avoid creating the unused mRefCnt member on nsSiteWindow.
Attachment #8630820 -
Attachment is obsolete: true
Attachment #8630820 -
Flags: review?(enndeakin)
Attachment #8630860 -
Flags: review?(enndeakin)
Assignee | ||
Comment 13•9 years ago
|
||
nsSiteWindow is slightly odd compared to other users of NS_IMPL_ADDREF_WITH_AGGREGATOR, in that it isn't allocated inline within the original struct (like DOMCSSDeclarationImpl or nsCSSFontFaceStyleDecl).
Code could be adjusted relatively easily to make the struct be inline, but it has the unfortunate consequence of forcing the nsSiteWindow object into the header file, as well as being more sketchy-seeming.
Updated•9 years ago
|
Attachment #8630860 -
Flags: review?(enndeakin) → review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 14•9 years ago
|
||
Keywords: checkin-needed
Comment 15•9 years ago
|
||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox42:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Comment 16•7 years ago
|
||
Moving to Core:XUL per https://bugzilla.mozilla.org/show_bug.cgi?id=1455336
Component: XP Toolkit/Widgets: XUL → XUL
You need to log in
before you can comment on or make changes to this bug.
Description
•