Closed Bug 1187552 Opened 4 years ago Closed 4 years ago

Support direct ownership of C++ objects by Java objects

Categories

(Firefox for Android :: General, defect)

All
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 42
Tracking Status
firefox42 --- fixed

People

(Reporter: jchen, Assigned: jchen)

References

Details

Attachments

(2 files)

The initial work done in bug 1186530 includes a WeakPtr ownership model, where the Java object owns a WeakPtr to the actual C++ object. This bug will add a support for a direct ownership model where the Java object owns the C++ object itself.
Add a direct ownership model where the Java object owns the
corresponding C++ object directly, in addition to the WeakPtr model
where the Java object owns a WeakPtr to the C++ object. The WeakPtr
model is chosen when the implementing C++ class inherits from
SupportsWeakPtr. Otherwise, the direct ownership model is chosen. Under
the direct ownership model, a UniquePtr object must be used to attach
the containing C++ object to a Java object, to ensure ownership is
passed on to the Java object.
Attachment #8641728 - Flags: review?(snorp)
Make NativeJSContainer/NativeJSObject Java objects own their
corresponding C++ objects directly, to reduce an extra
allocation/deallocation for each object and to simplify code.
Attachment #8641729 - Flags: review?(snorp)
Attachment #8641728 - Flags: review?(snorp) → review+
Attachment #8641729 - Flags: review?(snorp) → review+
https://hg.mozilla.org/mozilla-central/rev/20a9ea225587
https://hg.mozilla.org/mozilla-central/rev/6696b897b06e
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 42
You need to log in before you can comment on or make changes to this bug.