diff --git a/dom/audiochannel/AudioChannelService.cpp b/dom/audiochannel/AudioChannelService.cpp index f9431c5dbb1..dc0cb4b17a4 100644 --- a/dom/audiochannel/AudioChannelService.cpp +++ b/dom/audiochannel/AudioChannelService.cpp @@ -207,8 +207,7 @@ NS_IMPL_ADDREF(AudioChannelService) NS_IMPL_RELEASE(AudioChannelService) AudioChannelService::AudioChannelService() - : mDisabled(false) - , mDefChannelChildID(CONTENT_PROCESS_ID_UNKNOWN) + : mDefChannelChildID(CONTENT_PROCESS_ID_UNKNOWN) , mTelephonyChannel(false) , mContentOrNormalChannel(false) , mAnyChannel(false) @@ -238,10 +237,6 @@ void AudioChannelService::RegisterAudioChannelAgent(AudioChannelAgent* aAgent, AudioChannel aChannel) { - if (mDisabled) { - return; - } - uint64_t windowID = aAgent->WindowID(); AudioChannelWindow* winData = GetWindowData(windowID); if (!winData) { @@ -272,10 +267,6 @@ AudioChannelService::RegisterAudioChannelAgent(AudioChannelAgent* aAgent, void AudioChannelService::UnregisterAudioChannelAgent(AudioChannelAgent* aAgent) { - if (mDisabled) { - return; - } - AudioChannelWindow* winData = GetWindowData(aAgent->WindowID()); if (!winData) { return; @@ -466,8 +457,8 @@ AudioChannelService::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData) { if (!strcmp(aTopic, "xpcom-shutdown")) { - mDisabled = true; mWindows.Clear(); + Shutdown(); } #ifdef MOZ_WIDGET_GONK diff --git a/dom/audiochannel/AudioChannelService.h b/dom/audiochannel/AudioChannelService.h index 65f312d236b..a0a65d8c737 100644 --- a/dom/audiochannel/AudioChannelService.h +++ b/dom/audiochannel/AudioChannelService.h @@ -43,11 +43,6 @@ public: */ static already_AddRefed GetOrCreate(); - /** - * Shutdown the singleton. - */ - static void Shutdown(); - static bool IsAudioChannelMutedByDefault(); /** @@ -136,6 +131,11 @@ private: AudioChannelService(); ~AudioChannelService(); + /** + * Shutdown the singleton. + */ + static void Shutdown(); + void MaybeSendStatusUpdate(); bool ContentOrNormalChannelIsActive(); @@ -204,8 +204,6 @@ private: nsTArray mSpeakerManager; #endif - bool mDisabled; - nsCOMPtr mRunnable; uint64_t mDefChannelChildID; diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp index acd855cbed7..082578d32e9 100644 --- a/layout/build/nsLayoutStatics.cpp +++ b/layout/build/nsLayoutStatics.cpp @@ -433,8 +433,6 @@ nsLayoutStatics::Shutdown() nsHyphenationManager::Shutdown(); nsDOMMutationObserver::Shutdown(); - AudioChannelService::Shutdown(); - DataStoreService::Shutdown(); ContentParent::ShutDown();