tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 9c0b467506bc78c626f71c3d9fb2e7330d09ed6a
parent 4b2b3d0b71cb05a8e73cb5b92c22d332f27f275e
Author: agoloman <agoloman@mozilla.com>
Date:   Wed, 22 Oct 2025 23:47:56 +0300

Revert "Bug 1990812 - handle the case where switching the decoder state machine fails due to shutdown. r=media-playback-reviewers,chunmin" for causing build bustages @MediaDecoder.cpp.

This reverts commit 0bf980d7abf0f0fa3cb9c8904556fe7de61ffb10.

Diffstat:
Mdom/media/MediaDecoder.cpp | 14++++++--------
Mdom/media/MediaDecoder.h | 3+--
2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/dom/media/MediaDecoder.cpp b/dom/media/MediaDecoder.cpp @@ -381,7 +381,7 @@ void MediaDecoder::OnPlaybackErrorEvent(const MediaResult& aError) { #ifdef MOZ_WMF_MEDIA_ENGINE if (aError == NS_ERROR_DOM_MEDIA_EXTERNAL_ENGINE_NOT_SUPPORTED_ERR || aError == NS_ERROR_DOM_MEDIA_CDM_PROXY_NOT_SUPPORTED_ERR) { - Unused << SwitchStateMachine(aError); + SwitchStateMachine(aError); return; } #endif @@ -389,12 +389,12 @@ void MediaDecoder::OnPlaybackErrorEvent(const MediaResult& aError) { } #ifdef MOZ_WMF_MEDIA_ENGINE -bool MediaDecoder::SwitchStateMachine(const MediaResult& aError) { +void MediaDecoder::SwitchStateMachine(const MediaResult& aError) { MOZ_ASSERT(aError == NS_ERROR_DOM_MEDIA_EXTERNAL_ENGINE_NOT_SUPPORTED_ERR || aError == NS_ERROR_DOM_MEDIA_CDM_PROXY_NOT_SUPPORTED_ERR); // Already in shutting down decoder, no need to create another state machine. if (mPlayState == PLAY_STATE_SHUTDOWN) { - return false; + return; } // External engine can't play the resource or we intentionally disable it, try @@ -473,7 +473,6 @@ bool MediaDecoder::SwitchStateMachine(const MediaResult& aError) { discardStateMachine->BeginShutdown()->Then( AbstractThread::MainThread(), __func__, [discardStateMachine] {}); - return true; } #endif @@ -1514,13 +1513,12 @@ RefPtr<SetCDMPromise> MediaDecoder::SetCDMProxy(CDMProxy* aProxy) { // given CDM proxy. LOG("CDM proxy %s not supported! Switch to another state machine.", NS_ConvertUTF16toUTF8(aProxy->KeySystem()).get()); - bool switched = SwitchStateMachine( + SwitchStateMachine( MediaResult{NS_ERROR_DOM_MEDIA_CDM_PROXY_NOT_SUPPORTED_ERR, aProxy}); rv = GetStateMachine()->IsCDMProxySupported(aProxy); if (NS_FAILED(rv)) { - MOZ_DIAGNOSTIC_ASSERT( - !switched, "We should only reach here if we failed to switch"); - LOG("CDM proxy is still not supported!"); + MOZ_DIAGNOSTIC_CRASH("CDM proxy not supported after switch!"); + LOG("CDM proxy not supported after switch!"); return SetCDMPromise::CreateAndReject(rv, __func__); } } diff --git a/dom/media/MediaDecoder.h b/dom/media/MediaDecoder.h @@ -565,8 +565,7 @@ class MediaDecoder : public DecoderDoctorLifeLogger<MediaDecoder> { void ConnectMirrors(MediaDecoderStateMachineBase* aObject); void DisconnectMirrors(); # ifdef MOZ_WMF_MEDIA_ENGINE - // Return true if we switched to a new state machine. - bool SwitchStateMachine(const MediaResult& aError); + void SwitchStateMachine(const MediaResult& aError); # endif virtual bool CanPlayThroughImpl() = 0;