Bug 1154243 - Avoid calling QueryInterface in AudioChannelAgent::GetWindowVolume() unnecessarily; r=baku

This commit is contained in:
Ehsan Akhgari 2015-04-14 08:02:37 -04:00
parent 0ff1159b21
commit b077dbefae

View File

@ -199,12 +199,11 @@ AudioChannelAgent::GetWindowVolume(float* aVolume)
{
NS_ENSURE_ARG_POINTER(aVolume);
nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(mWindow);
if (!win) {
if (!mWindow) {
*aVolume = 1.0f;
return NS_OK;
}
*aVolume = win->GetAudioGlobalVolume();
*aVolume = mWindow->GetAudioGlobalVolume();
return NS_OK;
}