Bug 1113086 - AudioChannel policy in Browser API - patch 4 - Muted by default, e=alwu

This commit is contained in:
Andrea Marchesini 2015-07-10 17:38:49 +01:00 committed by Ehsan Akhgari
parent 901875354c
commit f25bbc3a43
3 changed files with 17 additions and 1 deletions

View File

@ -40,6 +40,9 @@ using namespace mozilla::hal;
namespace {
// If true, any new AudioChannelAgent will be muted when created.
bool sAudioChannelMutedByDefault = false;
void
NotifyChannelActive(uint64_t aWindowID, AudioChannel aAudioChannel,
bool aActive)
@ -169,6 +172,9 @@ AudioChannelService::AudioChannelService()
#endif
}
}
Preferences::AddBoolVarCache(&sAudioChannelMutedByDefault,
"dom.audiochannel.mutedByDefault");
}
AudioChannelService::~AudioChannelService()
@ -825,6 +831,12 @@ AudioChannelService::ChildStatusReceived(uint64_t aChildID,
data->mActiveContentOrNormalChannel = aContentOrNormalChannel;
}
/* static */ bool
AudioChannelService::IsAudioChannelMutedByDefault()
{
return sAudioChannelMutedByDefault;
}
/* static */ PLDHashOperator
AudioChannelService::NotifyEnumerator(AudioChannelAgent* aAgent,
AudioChannel* aAudioChannel,

View File

@ -48,6 +48,8 @@ public:
*/
static void Shutdown();
static bool IsAudioChannelMutedByDefault();
/**
* Any audio channel agent that starts playing should register itself to
* this service, sharing the AudioChannel.
@ -146,7 +148,7 @@ private:
{
AudioChannelConfig()
: mVolume(1.0)
, mMuted(false)
, mMuted(IsAudioChannelMutedByDefault())
, mNumberOfAgents(0)
{}

View File

@ -4957,6 +4957,8 @@ pref("reader.toolbar.vertical", true);
pref("media.gmp.insecure.allow", false);
#endif
pref("dom.audiochannel.mutedByDefault", false);
// Use vsync aligned rendering. b2g prefs are in b2g.js.
// Hardware vsync supported on windows, os x, and b2g.
// Linux and fennec will use software vsync.