tor-browser

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

commit e7711a0d0fb68ad1537738d8d12fb04bf72af84c
parent e3d7479594dce1bda74d1cebf6381b1e18b23a8e
Author: Andrew McCreight <continuation@gmail.com>
Date:   Mon, 10 Nov 2025 14:35:49 +0000

Bug 1999058 - Don't rely on default behavior for audio-playback in nsGlobalWindowInner::Observe. r=dom-core,smaug

This makes it so that we return NS_OK immediately, instead of falling through
to the NS_WARNING plus failure at the end of the function.

Differential Revision: https://phabricator.services.mozilla.com/D271862

Diffstat:
Mdom/base/nsGlobalWindowInner.cpp | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp @@ -5198,8 +5198,10 @@ nsGlobalWindowInner::ShowSlowScriptDialog(JSContext* aCx, nsresult nsGlobalWindowInner::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData) { - if (!nsCRT::strcmp(aTopic, "audio-playback") && - ToSupports(GetOuterWindow()) == aSubject) { + if (!nsCRT::strcmp(aTopic, "audio-playback")) { + if (ToSupports(GetOuterWindow()) != aSubject) { + return NS_OK; + } AUTO_PROFILER_MARKER_UNTYPED("audio-playback", DOM, {}); nsGlobalWindowOuter* outer =