From 20af818a6f44336244eec04cfa55aae3c6ac1a43 Mon Sep 17 00:00:00 2001 From: Alastor Wu Date: Sat, 4 Mar 2017 01:14:28 +0800 Subject: [PATCH] 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 --- dom/audiochannel/AudioChannelService.cpp | 7 ------- dom/audiochannel/AudioChannelService.h | 2 -- dom/base/nsGlobalWindow.cpp | 3 +-- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/dom/audiochannel/AudioChannelService.cpp b/dom/audiochannel/AudioChannelService.cpp index d70e4a66fd7a..05535c7aaf78 100644 --- a/dom/audiochannel/AudioChannelService.cpp +++ b/dom/audiochannel/AudioChannelService.cpp @@ -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::GetOrCreate() { diff --git a/dom/audiochannel/AudioChannelService.h b/dom/audiochannel/AudioChannelService.h index 56c2f1dfa761..ac87846e7bec 100644 --- a/dom/audiochannel/AudioChannelService.h +++ b/dom/audiochannel/AudioChannelService.h @@ -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. diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 43f7320fa0b8..ad7c9c8edd50 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -4241,8 +4241,7 @@ nsPIDOMWindowOuter::MaybeActiveMediaComponents() } if (!doc->Hidden() && - mMediaSuspend == nsISuspendedTypes::SUSPENDED_BLOCK && - AudioChannelService::IsServiceStarted()) { + mMediaSuspend == nsISuspendedTypes::SUSPENDED_BLOCK) { SetMediaSuspend(nsISuspendedTypes::NONE_SUSPENDED); } }