-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dom] Implement AbortSignal.any() memory management
This is the second part of the AbortSignal.any() prototype; it implements the memory management described in [1]. The idea is as follows: - A signal is "settled" if it can no longer emit events associated with the composition type (abort or priority). For abort, this means either the signal is aborted or it never will be; for priority, this means the priority can no longer change. A signal becomes settled if it aborts (for abort composition), if the signal's associated controller has been GCed (implemented with a prefinalizer), or if it's a composite signal and all of its parents have been settled. - Unsettled composite signals are kept alive as long as their effects (active event listeners, abort/priority algorithms) can be observed. This is implemented by making AbortSignal inherit from LazyActiveScriptWrappable (only enabled for composite signals) and determining activity based on settled state + active listeners and algorithms. This allows AbortSignalCompositionManager to hold weak references to all signals. This also adds a number of wpt_internal/ tests using a finalization registry to test signal lifetimes. The tests are mostly parameterized with an interface type so we can run these for TaskSignal as well (follow-up). [1] https://docs.google.com/document/d/1LvmsBLV85p-PhSGvTH-YwgD6onuhh1VXLg8jPlH32H4/edit?usp=sharing Bug: 1323391 Change-Id: I989c937e5359fffad72ff2c26068cc49b28e1a10 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3704585 Commit-Queue: Scott Haseley <shaseley@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1098063}
- Loading branch information
Showing
11 changed files
with
473 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.