Bug 1338137 - part2 : remove function IsServiceStarted(). r=baku

The reason we introduced the IsServiceStarted(), check bug1338466 comment5 for
more details.

The patch1 introduces more robust way to check the alive media component, so
we can remove IsServiceStarted().

MozReview-Commit-ID: LIma8hZTuhA

--HG--
extra : rebase_source : 4687ef41cc765f4ffeb97aeac63b727897456167
This commit is contained in:
Alastor Wu 2017-03-04 01:14:28 +08:00
Родитель 77053f1035
Коммит 20af818a6f
3 изменённых файлов: 1 добавлений и 11 удалений

Просмотреть файл

@ -203,13 +203,6 @@ AudioChannelService::CreateServiceIfNeeded()
}
}
/* static */ bool
AudioChannelService::IsServiceStarted()
{
// The service would start when the first AudioChannelAgent is created.
return !!gAudioChannelService;
}
/* static */ already_AddRefed<AudioChannelService>
AudioChannelService::GetOrCreate()
{

Просмотреть файл

@ -106,8 +106,6 @@ public:
static bool IsEnableAudioCompeting();
static bool IsServiceStarted();
/**
* Any audio channel agent that starts playing should register itself to
* this service, sharing the AudioChannel.

Просмотреть файл

@ -4241,8 +4241,7 @@ nsPIDOMWindowOuter::MaybeActiveMediaComponents()
}
if (!doc->Hidden() &&
mMediaSuspend == nsISuspendedTypes::SUSPENDED_BLOCK &&
AudioChannelService::IsServiceStarted()) {
mMediaSuspend == nsISuspendedTypes::SUSPENDED_BLOCK) {
SetMediaSuspend(nsISuspendedTypes::NONE_SUSPENDED);
}
}