Use more smart pointers in XPCWrappedJS

RESOLVED FIXED in mozilla29

Status

()

Core
XPConnect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: mccr8, Assigned: mccr8)

Tracking

unspecified
mozilla29
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

Comment hidden (empty)
(Assignee)

Comment 1

5 years ago
With this, the get forget stuff in SetAggregatedNativeObject may be simplifiable.
(Assignee)

Comment 2

5 years ago
This is fairly straightforward.  The only question is what to do with mRoot. This is an owning pointer only when it isn't |this|.  I could change it to be |null| instead of |this|, and make it always owning, and add a half dozen null-checks, but maybe I'll just document the ownership of mRoot instead.
Assignee: nobody → continuation
(Assignee)

Comment 3

5 years ago
Created attachment 8351194 [details] [diff] [review]
part 1 - Make nsXPCWrappedJS::mOuter into a smart pointer.
Attachment #8351194 - Flags: review?(bobbyholley+bmo)
(Assignee)

Comment 4

5 years ago
Created attachment 8351195 [details] [diff] [review]
part 2 - Make nsXPCWrappedJS::mClass a smart pointer.

try run: https://tbpl.mozilla.org/?tree=Try&rev=20caa5300e5e
Attachment #8351195 - Flags: review?(bobbyholley+bmo)
(Assignee)

Comment 5

5 years ago
Created attachment 8351196 [details] [diff] [review]
part 3 - Add comment about ownership of nsXPCWrappedJS::mRoot.
Attachment #8351196 - Flags: review?(bobbyholley+bmo)
Attachment #8351194 - Flags: review?(bobbyholley+bmo) → review+
Attachment #8351195 - Flags: review?(bobbyholley+bmo) → review+
Attachment #8351196 - Flags: review?(bobbyholley+bmo) → review+
https://hg.mozilla.org/mozilla-central/rev/5cccbc60db9c
https://hg.mozilla.org/mozilla-central/rev/0c95ce70e969
https://hg.mozilla.org/mozilla-central/rev/060805681c3a
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.