зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset ddc08e87843f (bug 1184058) for AudioChannelAgent crashes/asserts.
This commit is contained in:
Родитель
8247350bbe
Коммит
3a9297bd76
|
@ -103,23 +103,17 @@ AudioChannelAgent::InitInternal(nsIDOMWindow* aWindow, int32_t aChannelType,
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NS_WARN_IF(!aWindow)) {
|
if (aWindow) {
|
||||||
return NS_ERROR_FAILURE;
|
nsCOMPtr<nsPIDOMWindow> pInnerWindow = do_QueryInterface(aWindow);
|
||||||
}
|
MOZ_ASSERT(pInnerWindow->IsInnerWindow());
|
||||||
|
mInnerWindowID = pInnerWindow->WindowID();
|
||||||
|
|
||||||
nsCOMPtr<nsPIDOMWindow> pInnerWindow = do_QueryInterface(aWindow);
|
nsCOMPtr<nsIDOMWindow> topWindow;
|
||||||
MOZ_ASSERT(pInnerWindow->IsInnerWindow());
|
aWindow->GetScriptableTop(getter_AddRefs(topWindow));
|
||||||
mInnerWindowID = pInnerWindow->WindowID();
|
mWindow = do_QueryInterface(topWindow);
|
||||||
|
if (mWindow) {
|
||||||
nsCOMPtr<nsIDOMWindow> topWindow;
|
mWindow = mWindow->GetOuterWindow();
|
||||||
aWindow->GetScriptableTop(getter_AddRefs(topWindow));
|
}
|
||||||
mWindow = do_QueryInterface(topWindow);
|
|
||||||
if (mWindow) {
|
|
||||||
mWindow = mWindow->GetOuterWindow();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!mWindow) {
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mAudioChannelType = aChannelType;
|
mAudioChannelType = aChannelType;
|
||||||
|
@ -140,13 +134,6 @@ NS_IMETHODIMP AudioChannelAgent::NotifyStartedPlaying(uint32_t aNotifyPlayback,
|
||||||
MOZ_ASSERT(aVolume);
|
MOZ_ASSERT(aVolume);
|
||||||
MOZ_ASSERT(aMuted);
|
MOZ_ASSERT(aMuted);
|
||||||
|
|
||||||
// Window-less AudioChannelAgents are muted by default.
|
|
||||||
if (!mWindow) {
|
|
||||||
*aVolume = 0;
|
|
||||||
*aMuted = true;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsRefPtr<AudioChannelService> service = AudioChannelService::GetOrCreate();
|
nsRefPtr<AudioChannelService> service = AudioChannelService::GetOrCreate();
|
||||||
if (mAudioChannelType == AUDIO_AGENT_CHANNEL_ERROR ||
|
if (mAudioChannelType == AUDIO_AGENT_CHANNEL_ERROR ||
|
||||||
service == nullptr || mIsRegToService) {
|
service == nullptr || mIsRegToService) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче