Closed
Bug 1322459
Opened 8 years ago
Closed 7 years ago
Fix duplicate refcnt member errors that clang plugin reports on Windows
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Tracking
(firefox53 fixed)
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox53 | --- | fixed |
People
(Reporter: ting, Assigned: ting)
References
Details
Attachments
(3 files, 1 obsolete file)
No description provided.
Assignee | ||
Comment 1•8 years ago
|
||
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Attachment #8817349 -
Attachment is obsolete: true
Assignee | ||
Comment 5•8 years ago
|
||
I am not sure do we need NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, WeakJumpListItem) in NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(JumpListShortcut) NS_INTERFACE_MAP_ENTRY(nsIJumpListShortcut) NS_INTERFACE_MAP_END
Comment 6•8 years ago
|
||
mozreview-review |
Comment on attachment 8818217 [details] Bug 1322459 part 1 - Remove duplicate mRefCnt in CaptureSinkFilter. https://reviewboard.mozilla.org/r/98358/#review98666
Attachment #8818217 -
Flags: review?(ehsan) → review+
Comment 7•8 years ago
|
||
mozreview-review |
Comment on attachment 8818218 [details] Bug 1322459 part 2 - Remove duplicate mRefCnt in JumpListShortCut. https://reviewboard.mozilla.org/r/98360/#review98668 ::: widget/windows/JumpListItem.h:58 (Diff revision 1) > +class JumpListItem : public WeakJumpListItem > +{ > +public: > + using WeakJumpListItem::WeakJumpListItem; > + > + NS_DECL_ISUPPORTS Instead of adding this in a mixin class, you should remove this mixin class altogether, and add the NS_DECL_ISUPPORTS and friends to each individual leaf class in the hierarchy. Without that, using such mixin classes in the multi-inheritance scenario is risky since you can still end up with a duplicate mRefCnt through two of your base classes.
Attachment #8818218 -
Flags: review?(ehsan) → review-
Comment 8•8 years ago
|
||
mozreview-review |
Comment on attachment 8818219 [details] Bug 1322459 part 3 - Remove duplicate mRefCnt in LSPAnnotationGatherer. https://reviewboard.mozilla.org/r/98362/#review98670
Attachment #8818219 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 9•8 years ago
|
||
(In reply to :Ehsan Akhgari from comment #7) > Instead of adding this in a mixin class, you should remove this mixin class > altogether, and add the NS_DECL_ISUPPORTS and friends to each individual > leaf class in the hierarchy. Without that, using such mixin classes in the > multi-inheritance scenario is risky since you can still end up with a > duplicate mRefCnt through two of your base classes. Do you mean to remove JumpListItem? If yes, then we won't be able to create an instance of nsIJumpListItem which would be different from original code.
Comment 10•8 years ago
|
||
No, I mean doing something like this: 1. Remove NS_DECL_ISUPPORTS from JumpListItem. 2. Rename JumpListItem to JumpListItemBase or some such. 3. Create a new class named JumpListItem derived from JumpListItemBase. 4. Add NS_DECL_ISUPPORTS and friends to the new JumpListItem, as well as the rest of the leaf classes (JumpListSeparator, JumpListLink, and JumpListShortcut.)
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 13•8 years ago
|
||
mozreview-review |
Comment on attachment 8818218 [details] Bug 1322459 part 2 - Remove duplicate mRefCnt in JumpListShortCut. https://reviewboard.mozilla.org/r/98360/#review99140 ::: widget/windows/JumpListItem.h:58 (Diff revision 2) > -class JumpListSeparator : public JumpListItem, public nsIJumpListSeparator > +class JumpListItem : public JumpListItemBase > +{ > + ~JumpListItem() {} > + > +public: > + using JumpListItemBase::JumpListItemBase; Hm, what's this? :-) You can't usefully import the constructor name for the base class here, since you wouldn't be able to call that function. Honestly I'm surprised the compiler even accepts this!!
Attachment #8818218 -
Flags: review?(ehsan) → review+
Comment hidden (obsolete) |
Assignee | ||
Comment 15•8 years ago
|
||
mozreview-review-reply |
Comment on attachment 8818218 [details] Bug 1322459 part 2 - Remove duplicate mRefCnt in JumpListShortCut. https://reviewboard.mozilla.org/r/98360/#review99140 > Hm, what's this? :-) You can't usefully import the constructor name for the base class here, since you wouldn't be able to call that function. Honestly I'm surprised the compiler even accepts this!! It's inheriting constructors from JumpListItemBase, so JumpListItem still has the constructors in original version.
Assignee | ||
Comment 16•8 years ago
|
||
If there's no other concern with the inheriting constructors, I'll mark the review issue fixed and land the patches, thanks.
Comment 17•8 years ago
|
||
Neat, I didn't know about this trick! Looks good.
Comment 18•7 years ago
|
||
Pushed by tchou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b207d21ee5a5 part 1 - Remove duplicate mRefCnt in CaptureSinkFilter. r=Ehsan https://hg.mozilla.org/integration/autoland/rev/fd91d5daa174 part 2 - Remove duplicate mRefCnt in JumpListShortCut. r=Ehsan https://hg.mozilla.org/integration/autoland/rev/0ef8a1d7e4d6 part 3 - Remove duplicate mRefCnt in LSPAnnotationGatherer. r=Ehsan
Comment 19•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b207d21ee5a5 https://hg.mozilla.org/mozilla-central/rev/fd91d5daa174 https://hg.mozilla.org/mozilla-central/rev/0ef8a1d7e4d6
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → janus926
Updated•6 years ago
|
Product: Core → Firefox Build System
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•