Closed
Bug 814752
Opened 13 years ago
Closed 13 years ago
Make NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER generic
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: mccr8, Assigned: mccr8)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
5.14 KB,
patch
|
smaug
:
review+
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
Right now, this has two cases, one for natives and one for nsISupports:
#define NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER \
nsContentUtils::ReleaseWrapper(static_cast<nsISupports*>(p), tmp);
#define NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER_NATIVE \
nsContentUtils::ReleaseWrapper(tmp, tmp);
After some of the cleanup patches I have in the pipeline are applied, this is the only thing stopping at least AudioContext from using the generic NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_n macros. bjacob's templatization technique should work here.
Assignee | ||
Comment 1•13 years ago
|
||
As far as I can tell, the cast to nsISupports doesn't really do anything: it static casts from void* to nsISupports*, which I assume is always a no-op. For the native case, tmp is the result of calling DowncastCCParticipant, which just just doing a static cast from void* to T*, where T is the CC class, which again should be a no-op. Thus I think we can combine the two functions by just dropping the cast, and using the raw void* argument as the first argument. Am I wrong about that?
This lets us shorten up the existing users of the _NATIVE unlink.
Assignee: nobody → continuation
Assignee | ||
Comment 2•13 years ago
|
||
Attachment #685298 -
Attachment is obsolete: true
Assignee | ||
Comment 3•13 years ago
|
||
Assignee | ||
Comment 4•13 years ago
|
||
Comment on attachment 685301 [details] [diff] [review]
drop the unnecessary cast
Hopefully you understand why the cache stuff enough (eg more than me) to understand why the existing code is the way it is. The important stuff is in nsWrapperCache.h, the rest is just taking advantage of the other changes to boil away some macros.
Attachment #685301 -
Flags: review?(bugs)
Comment 5•13 years ago
|
||
Comment on attachment 685301 [details] [diff] [review]
drop the unnecessary cast
ehsan might want to look at this just to know that audio code is being changed.
Attachment #685301 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 6•13 years ago
|
||
Comment on attachment 685301 [details] [diff] [review]
drop the unnecessary cast
Just for the Audio changes. I merged together the two UNLINK_PRESERVED_WRAPPER macros, so now we can use the WRAPPER_CACHE_N macros for a few audio classes.
Attachment #685301 -
Flags: review?(ehsan)
Comment 7•13 years ago
|
||
Comment on attachment 685301 [details] [diff] [review]
drop the unnecessary cast
Review of attachment 685301 [details] [diff] [review]:
-----------------------------------------------------------------
Yay!
Attachment #685301 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 8•13 years ago
|
||
Comment 9•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•