Closed Bug 1957847 Opened 1 year ago Closed 1 year ago

Convert more JS holders to use Hold/DropJSObjectsWithKey APIs where appropriate

Categories

(Core :: XPCOM, enhancement)

enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(3 files)

Following on from bug 1953167, we can convert more JS holders to use the new Hold/DropJSObjectsWithKey APIs, where approriate. This should be more efficient for holders that are always added to the map and call HoldJSObjects during initialization.

Promise and CallbackTimeoutHandler might be good candidates. They are not WrapperCached, so the preserving wrapper won't trigger the other holdJSObjects call.

This adds static assertions that the Add/DropJSHoldersWithKey APIs are not used
for wrapper cached objects, and runtime assertions that these APIs are not used
for objects that were previously used with the original Add/DropJSHolders APIs.
Unfortunately it's not possible to check the inverse of the latter case.

Assignee: nobody → jcoppeard
Status: NEW → ASSIGNED
Keywords: leave-open
Summary: Convert more JS holders to use Hold/DropJSObjectsWithKey APIs where approriate → Convert more JS holders to use Hold/DropJSObjectsWithKey APIs where appropriate
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/82cd5111cd88 Part 1: Add assertions to catch misuse of Add/DropJSHolders APIs r=smaug https://hg.mozilla.org/integration/autoland/rev/c94929a03423 Part 2: Use Add/DropJSHoldersWithKey APIs for Promise r=smaug https://hg.mozilla.org/integration/autoland/rev/4ee747773a72 Part 3: Use Add/DropJSHoldersWithKey APIs for CallbackTimeoutHandler r=smaug
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Keywords: leave-open
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: