mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1113086 - AudioChannel policy in Browser API - patch 7 - Support non-app iframe, r=alwu
This commit is contained in:
parent
edc798be42
commit
f59934329a
@ -9,7 +9,6 @@ SimpleTest.waitForExplicitFinish();
|
||||
browserElementTestHelpers.setEnabledPref(true);
|
||||
browserElementTestHelpers.addPermission();
|
||||
|
||||
SpecialPowers.setBoolPref("dom.testing.browserElementAudioChannel.noapp", true);
|
||||
SpecialPowers.setBoolPref("media.useAudioChannelService", true);
|
||||
|
||||
function noaudio() {
|
||||
|
@ -520,9 +520,6 @@ nsBrowserElement::GetAllowedAudioChannels(
|
||||
{
|
||||
aAudioChannels.Clear();
|
||||
|
||||
NS_ENSURE_TRUE_VOID(IsBrowserElementOrThrow(aRv));
|
||||
NS_ENSURE_TRUE_VOID(IsNotWidgetOrThrow(aRv));
|
||||
|
||||
// If empty, it means that this is the first call of this method.
|
||||
if (mBrowserElementAudioChannels.IsEmpty()) {
|
||||
nsCOMPtr<nsIFrameLoader> frameLoader = GetFrameLoader();
|
||||
@ -531,6 +528,16 @@ nsBrowserElement::GetAllowedAudioChannels(
|
||||
return;
|
||||
}
|
||||
|
||||
bool isBrowserOrApp;
|
||||
aRv = frameLoader->GetOwnerIsBrowserOrAppFrame(&isBrowserOrApp);
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isBrowserOrApp) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMElement> frameElement;
|
||||
aRv = frameLoader->GetOwnerElement(getter_AddRefs(frameElement));
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
@ -587,14 +594,6 @@ nsBrowserElement::GetAllowedAudioChannels(
|
||||
return;
|
||||
}
|
||||
|
||||
bool noapp = false;
|
||||
Preferences::GetBool("dom.testing.browserElementAudioChannel.noapp", &noapp);
|
||||
|
||||
if (!noapp && !app) {
|
||||
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Normal is always allowed.
|
||||
nsTArray<nsRefPtr<BrowserElementAudioChannel>> channels;
|
||||
|
||||
@ -609,7 +608,6 @@ nsBrowserElement::GetAllowedAudioChannels(
|
||||
|
||||
channels.AppendElement(ac);
|
||||
|
||||
// app can be null in case we are in a test.
|
||||
if (app) {
|
||||
const nsAttrValue::EnumTable* audioChannelTable =
|
||||
AudioChannelService::GetAudioChannelTable();
|
||||
|
@ -30,7 +30,7 @@ interface BrowserElementAudioChannel : EventTarget {
|
||||
};
|
||||
|
||||
partial interface BrowserElementPrivileged {
|
||||
[Constant, Cached, Throws,
|
||||
[Pure, Cached, Throws,
|
||||
Pref="dom.mozBrowserFramesEnabled",
|
||||
CheckPermissions="browser"]
|
||||
readonly attribute sequence<BrowserElementAudioChannel> allowedAudioChannels;
|
||||
|
Loading…
Reference in New Issue
Block a user