Closed
Bug 1259706
Opened 9 years ago
Closed 9 years ago
Add NS_INLINE_DECL_THREADSAFE_REFCOUNTING macro equivalent that declare AddRef and Release as virtual
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: jya, Assigned: jya)
Details
Attachments
(1 file)
It would be useful to be able to declare the AddRef and Release method as virtual so that they can be overridden in inheriting class.
Something like NS_INLINE_IDECL_THREADSAFE_REFCOUNTING
I think it would be much better if NS_INLINE_DECL_THREADSAFE_REFCOUNTING simply declared those functions as virtual all the time, but seeing it's been like this for over a decade it's probably preferred as it is.
Assignee | ||
Comment 1•9 years ago
|
||
Allow to generate virtual AddRef/Release methods.
Review commit: https://reviewboard.mozilla.org/r/42455/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/42455/
Attachment #8734703 -
Flags: review?(nfroyd)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → jyavenard
![]() |
||
Updated•9 years ago
|
Attachment #8734703 -
Flags: review?(nfroyd) → review+
![]() |
||
Comment 2•9 years ago
|
||
Comment on attachment 8734703 [details]
MozReview Request: Bug 1259706: Add NS_INLINE_DECL_THREADSAFE_VIRTUAL_REFCOUNTING macro. r=froydnj
https://reviewboard.mozilla.org/r/42455/#review39623
r=me with the change below. I think the name should feature `VIRTUAL` in it, but am happy to hear other suggestions for naming.
::: xpcom/glue/nsISupportsImpl.h:568
(Diff revision 1)
> +
> +/**
> + * Like NS_INLINE_DECL_THREADSAFE_REFCOUNTING with AddRef & Release declared
> + * virtual.
> + */
> +#define NS_INLINE_IDECL_THREADSAFE_REFCOUNTING(_class, ...) \
I think the `I` here is a little hard to miss. Let's name it sort-of-consistently with the patches for bug 1184283. Perhaps `NS_INLINE_DECL_THREADSAFE_VIRTUAL_REFCOUNTING`?
Assignee | ||
Comment 3•9 years ago
|
||
Sounds good to me with virtual.
I had used the "I" because the other addRef/Release declaration that are virtuals only differs by the letter I (NS_METHOD vs NS_IMETHOD)
Assignee | ||
Comment 4•9 years ago
|
||
Comment on attachment 8734703 [details]
MozReview Request: Bug 1259706: Add NS_INLINE_DECL_THREADSAFE_VIRTUAL_REFCOUNTING macro. r=froydnj
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/42455/diff/1-2/
Attachment #8734703 -
Attachment description: MozReview Request: Bug 1259706: Add NS_INLINE_IDECL_THREADSAFE_REFCOUNTING macro. r?froydnj → MozReview Request: Bug 1259706: Add NS_INLINE_DECL_THREADSAFE_VIRTUAL_REFCOUNTING macro. r=froydnj
Comment 6•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in
before you can comment on or make changes to this bug.
Description
•