ASSERT under HTMLMediaElement::virtualHasPendingActivity#64228
Merged
webkit-commit-queue merged 1 commit intoMay 5, 2026
Merged
Conversation
Collaborator
|
EWS run on previous version of this PR (hash b1ac587) Details |
jyavenard
approved these changes
May 5, 2026
Member
|
The explanation doesn't make much sense. The main thread is paused while HTMLMediaElement::virtualHasPendingActivity is being called. |
b1ac587 to
be78faa
Compare
Collaborator
|
EWS run on current version of this PR (hash be78faa) Details
|
rniwa
approved these changes
May 5, 2026
https://bugs.webkit.org/show_bug.cgi?id=314034 rdar://176143872 Reviewed by Jean-Yves Avenard and Ryosuke Niwa. Many MediaPlayerPrivateMediaSourceAVFObjC member variables are a main-thread-only but it can be access from the worker thread by the MediaSource/Private, so its destructor should always run on the main thread. While investigation this it was observed that HTMLMediaElement::virtualHasPendingActivity may be called from the GC thread but it calls HTMLMediaElement::canProduceAudio() which calls MediaPlayer::hasAudio() and creates a temporary RefPtr to the MediaPlayerPrivate. This is unnecessary as every MediaPlayer notifies HTMLMediaElement when its ability to produce audio changes, so fix this by caching `canProduceAudio` in a std::atomic which is updated only on the main thread whenever relevant state changes. canProduceAudio() now just returns the cached value and is safe to call from any thread. * Source/WebCore/html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::canProduceAudio const): (WebCore::HTMLMediaElement::computeCanProduceAudio const): (WebCore::HTMLMediaElement::canProduceAudioChanged): * Source/WebCore/html/HTMLMediaElement.h: * Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: Canonical link: https://commits.webkit.org/312598@main
be78faa to
640e6ff
Compare
Collaborator
|
Committed 312598@main (640e6ff): https://commits.webkit.org/312598@main Reviewed commits have been landed. Closing PR #64228 and removing active labels. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🛠 ios-apple
640e6ff
be78faa
🛠 win🧪 win-tests🧪 ios-wk2-wpt🧪 api-mac-debug🧪 api-ios