Bug 987290 - Tweak AudioChannel enum conversions to please typed enums - r=ehsan

This commit is contained in:
Benoit Jacob 2014-04-25 22:34:04 -04:00
parent 82b5784319
commit eea6744801

View File

@ -85,20 +85,13 @@ AudioChannelAgent::InitInternal(nsIDOMWindow* aWindow, int32_t aChannelType,
// We syncd the enum of channel type between nsIAudioChannelAgent.idl and
// AudioChannelBinding.h the same.
MOZ_ASSERT(static_cast<AudioChannel>(AUDIO_AGENT_CHANNEL_NORMAL) ==
AudioChannel::Normal &&
static_cast<AudioChannel>(AUDIO_AGENT_CHANNEL_CONTENT) ==
AudioChannel::Content &&
static_cast<AudioChannel>(AUDIO_AGENT_CHANNEL_NOTIFICATION) ==
AudioChannel::Notification &&
static_cast<AudioChannel>(AUDIO_AGENT_CHANNEL_ALARM) ==
AudioChannel::Alarm &&
static_cast<AudioChannel>(AUDIO_AGENT_CHANNEL_TELEPHONY) ==
AudioChannel::Telephony &&
static_cast<AudioChannel>(AUDIO_AGENT_CHANNEL_RINGER) ==
AudioChannel::Ringer &&
static_cast<AudioChannel>(AUDIO_AGENT_CHANNEL_PUBLICNOTIFICATION) ==
AudioChannel::Publicnotification,
MOZ_ASSERT(int(AUDIO_AGENT_CHANNEL_NORMAL) == int(AudioChannel::Normal) &&
int(AUDIO_AGENT_CHANNEL_CONTENT) == int(AudioChannel::Content) &&
int(AUDIO_AGENT_CHANNEL_NOTIFICATION) == int(AudioChannel::Notification) &&
int(AUDIO_AGENT_CHANNEL_ALARM) == int(AudioChannel::Alarm) &&
int(AUDIO_AGENT_CHANNEL_TELEPHONY) == int(AudioChannel::Telephony) &&
int(AUDIO_AGENT_CHANNEL_RINGER) == int(AudioChannel::Ringer) &&
int(AUDIO_AGENT_CHANNEL_PUBLICNOTIFICATION) == int(AudioChannel::Publicnotification),
"Enum of channel on nsIAudioChannelAgent.idl should be the same with AudioChannelBinding.h");
if (mAudioChannelType != AUDIO_AGENT_CHANNEL_ERROR ||