Backed out changeset 21a5c9152c3b (bug 1183925) for B2G debug mochitest crashes.

This commit is contained in:
Ryan VanderMeulen 2015-07-15 11:29:50 -04:00
parent eed4479c2c
commit 2f23e06096
3 changed files with 20 additions and 7 deletions

View File

@ -207,7 +207,8 @@ NS_IMPL_ADDREF(AudioChannelService)
NS_IMPL_RELEASE(AudioChannelService)
AudioChannelService::AudioChannelService()
: mDefChannelChildID(CONTENT_PROCESS_ID_UNKNOWN)
: mDisabled(false)
, mDefChannelChildID(CONTENT_PROCESS_ID_UNKNOWN)
, mTelephonyChannel(false)
, mContentOrNormalChannel(false)
, mAnyChannel(false)
@ -237,6 +238,10 @@ void
AudioChannelService::RegisterAudioChannelAgent(AudioChannelAgent* aAgent,
AudioChannel aChannel)
{
if (mDisabled) {
return;
}
uint64_t windowID = aAgent->WindowID();
AudioChannelWindow* winData = GetWindowData(windowID);
if (!winData) {
@ -267,6 +272,10 @@ AudioChannelService::RegisterAudioChannelAgent(AudioChannelAgent* aAgent,
void
AudioChannelService::UnregisterAudioChannelAgent(AudioChannelAgent* aAgent)
{
if (mDisabled) {
return;
}
AudioChannelWindow* winData = GetWindowData(aAgent->WindowID());
if (!winData) {
return;
@ -457,8 +466,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

View File

@ -43,6 +43,11 @@ public:
*/
static already_AddRefed<AudioChannelService> GetOrCreate();
/**
* Shutdown the singleton.
*/
static void Shutdown();
static bool IsAudioChannelMutedByDefault();
/**
@ -131,11 +136,6 @@ private:
AudioChannelService();
~AudioChannelService();
/**
* Shutdown the singleton.
*/
static void Shutdown();
void MaybeSendStatusUpdate();
bool ContentOrNormalChannelIsActive();
@ -204,6 +204,8 @@ private:
nsTArray<SpeakerManagerService*> mSpeakerManager;
#endif
bool mDisabled;
nsCOMPtr<nsIRunnable> mRunnable;
uint64_t mDefChannelChildID;

View File

@ -435,6 +435,8 @@ nsLayoutStatics::Shutdown()
nsHyphenationManager::Shutdown();
nsDOMMutationObserver::Shutdown();
AudioChannelService::Shutdown();
DataStoreService::Shutdown();
ContentParent::ShutDown();