Closed
Bug 1000922
Opened 10 years ago
Closed 9 years ago
Use nsMainThreadPtrHandle instead of passing around already_AddRefed and calling forget everywhere
Categories
(Toolkit Graveyard :: OS.File, defect)
Tracking
(firefox43 fixed)
RESOLVED
FIXED
mozilla43
Tracking | Status | |
---|---|---|
firefox43 | --- | fixed |
People
(Reporter: jdm, Assigned: chmanchester, Mentored)
References
Details
(Whiteboard: [lang=c++])
Attachments
(1 file)
The code in NativeOSFileInternals.cpp looks more complicated than necessary in my quick skim. As far as I can tell, we're passing around references to main-thread-only callback interfaces as already_AddRefed, storing them in nsCOMPtr and then forgetting them before a release happens, all to avoid forbidden refcounting on XPConnect wrappers. We can do this more simply and correctly by storing nsMainThreadPtrHandle types in the nsRunnable derivatives instead, and that will remove the need for all of the forget calls too.
Comment 1•10 years ago
|
||
Oh, we have such a thing as nsMainThreadPtrHandle? I couldn't find anything such when I wrote NativeOSFileInternals.cpp. Definitely, this can be used to simplify the code.
Comment 2•10 years ago
|
||
I could work on that if needed, even though it looks like a good bug for mentoring!
(In reply to David Rajchenbach Teller [:Yoric] (please use "needinfo?" - I'll be away on April 9th-16th) from comment #1)
> Oh, we have such a thing as nsMainThreadPtrHandle? I couldn't find anything
> such when I wrote NativeOSFileInternals.cpp. Definitely, this can be used to
> simplify the code.
Reporter | ||
Comment 3•10 years ago
|
||
You're always welcome to mentor it if you'd like!
Reporter | ||
Updated•10 years ago
|
Mentor: josh
Whiteboard: [lang=c++]
Assignee | ||
Comment 4•9 years ago
|
||
Assignee: nobody → cmanchester
Assignee | ||
Comment 5•9 years ago
|
||
Bug 1000922 - Use nsMainThreadPtrHandle instead of already_AddRefed and forget for callbacks in NativeOSFileInternals.cpp r=jdm
Attachment #8653024 -
Flags: review?(josh)
Reporter | ||
Comment 6•9 years ago
|
||
Comment on attachment 8653024 [details]
MozReview Request: Bug 1000922 - Use nsMainThreadPtrHandle instead of already_AddRefed and forget for callbacks in NativeOSFileInternals.cpp r=jdm
https://reviewboard.mozilla.org/r/16445/#review15771
Looks good! Thanks for doing this work!
Attachment #8653024 -
Flags: review?(josh) → review+
Comment 8•9 years ago
|
||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Updated•1 year ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•