forked from mirrors/gecko-dev
nsXPCWrappedJS use a special extra refcount to support weak references. When a WJS is held alive only by this refcount, instead of holding its JS object alive, the JS object holds it alive. This patch adds support for properly cycle collecting WJS in this state. First, it makes it so the CC will traverse these WJS, so that it has a chance to collect them. Secondly, it represents the reference from the JS object to the WJS via the NoteWeakMapping API. This lets us represent a strong reference outside of the actual object. This also adds some basic tests for the lifetime of WJS with weak references. The first two tests pass with and without this patch. This patch makes the third test pass. Differential Revision: https://phabricator.services.mozilla.com/D157672 |
||
|---|---|---|
| .. | ||
| browser.ini | ||
| browser_consoleStack.html | ||
| browser_dead_object.js | ||
| browser_deadObjectOnUnload.html | ||
| browser_exception_leak.js | ||
| browser_freeze_builtins.js | ||
| browser_import_mapped_jsm.js | ||
| browser_parent_process_hang_telemetry.js | ||
| browser_promise_userInteractionHandling.html | ||
| browser_promise_userInteractionHandling.js | ||
| browser_realm_key_and_document_domain.js | ||
| browser_realm_key_object_prototype_frame.html | ||
| browser_realm_key_object_prototype_top.html | ||
| browser_realm_key_promise_frame.html | ||
| browser_realm_key_promise_top.html | ||
| browser_weak_xpcwjs.js | ||
| moz.build | ||