chore: cherry-pick fd211b44535c from chromium #22869
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
AudioContext HasPendingActivity unless it's closed
An AudioContext is considered to have activity if it's not closed.
Previously, suspended contexts were considered has having no activity,
but that's not quite true since the context can be resumed at any time
after. This would allow contexts to be collected prematurely even
though the context was resumed. This causes the audio thread to
access objects that are possibly deleted.
Manually tested against test case from the bug; no issues seen.
TBR=hongchan@chromium.org
(cherry picked from commit 5efc951230de524c2b6787e25ec651c46f2652b4)
Bug: 1023810
Change-Id: I81cc0aff57bf4701b3ef9c36dd72b7e8922af5b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1955339
Reviewed-by: Hongchan Choi hongchan@chromium.org
Commit-Queue: Raymond Toy rtoy@chromium.org
Cr-Original-Commit-Position: refs/heads/master@{#724364}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1969044
Reviewed-by: Raymond Toy rtoy@chromium.org
Cr-Commit-Position: refs/branch-heads/3987@{#158}
Cr-Branched-From: c4e8da9871cc266be74481e212f3a5252972509d-refs/heads/master@{#722274}
Notes: Security: backported fix for use-after-poison in WebAudio (crbug.com/1023810)