Add additional assertions to the MDSM

This commit is contained in:
trav90
2017-03-12 04:03:12 -05:00
committed by roytam1
parent 06641d0cb5
commit ba4e0eb433
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -797,6 +797,7 @@ MediaDecoderStateMachine::OnAudioDecoded(AudioData* aAudioSample)
void
MediaDecoderStateMachine::Push(AudioData* aSample)
{
MOZ_ASSERT(OnTaskQueue());
MOZ_ASSERT(aSample);
// TODO: Send aSample to MSG and recalculate readystate before pushing,
// otherwise AdvanceFrame may pop the sample before we have a chance
@@ -814,6 +815,7 @@ MediaDecoderStateMachine::Push(AudioData* aSample)
void
MediaDecoderStateMachine::Push(VideoData* aSample)
{
MOZ_ASSERT(OnTaskQueue());
MOZ_ASSERT(aSample);
// TODO: Send aSample to MSG and recalculate readystate before pushing,
// otherwise AdvanceFrame may pop the sample before we have a chance
@@ -1176,6 +1178,7 @@ void MediaDecoderStateMachine::StopPlayback()
void MediaDecoderStateMachine::MaybeStartPlayback()
{
MOZ_ASSERT(OnTaskQueue());
AssertCurrentThreadInMonitor();
if (IsPlaying()) {
// Logging this case is really spammy - don't do it.
@@ -1232,6 +1235,7 @@ void MediaDecoderStateMachine::UpdatePlaybackPositionInternal(int64_t aTime)
void MediaDecoderStateMachine::UpdatePlaybackPosition(int64_t aTime)
{
MOZ_ASSERT(OnTaskQueue());
UpdatePlaybackPositionInternal(aTime);
bool fragmentEnded = mFragmentEndTime >= 0 && GetMediaTime() >= mFragmentEndTime;
@@ -1727,6 +1731,7 @@ MediaDecoderStateMachine::SetReaderIdle()
void
MediaDecoderStateMachine::DispatchDecodeTasksIfNeeded()
{
MOZ_ASSERT(OnTaskQueue());
AssertCurrentThreadInMonitor();
if (mState != DECODER_STATE_DECODING &&
@@ -2168,6 +2173,7 @@ MediaDecoderStateMachine::OnMetadataNotRead(ReadMetadataFailureReason aReason)
void
MediaDecoderStateMachine::EnqueueLoadedMetadataEvent()
{
MOZ_ASSERT(OnTaskQueue());
nsAutoPtr<MediaInfo> info(new MediaInfo());
*info = mInfo;
MediaDecoderEventVisibility visibility = mSentLoadedMetadataEvent?
@@ -2182,6 +2188,7 @@ MediaDecoderStateMachine::EnqueueLoadedMetadataEvent()
void
MediaDecoderStateMachine::EnqueueFirstFrameLoadedEvent()
{
MOZ_ASSERT(OnTaskQueue());
nsAutoPtr<MediaInfo> info(new MediaInfo());
*info = mInfo;
MediaDecoderEventVisibility visibility = mSentFirstFrameLoadedEvent?