Bug 1300479. Part 2 - replace empty cases with the default case. draft
authorJW Wang <jwwang@mozilla.com>
Mon, 05 Sep 2016 15:35:55 +0800
changeset 410079 8872eb2df1720504a5386e2a559605a9120880e2
parent 410078 0cd30f18cb0484b64178cdb0dc268b2a8d54806c
child 410080 a2590cddffbf76f71453a5c538d30b7639cb03ce
push id28635
push userjwwang@mozilla.com
push dateTue, 06 Sep 2016 05:20:34 +0000
bugs1300479
milestone51.0a1
Bug 1300479. Part 2 - replace empty cases with the default case. MozReview-Commit-ID: 7iXd8UtivEn
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2274,23 +2274,16 @@ MediaDecoderStateMachine::RunStateMachin
 
   mDelayedScheduler.Reset(); // Must happen on state machine task queue.
   mDispatchedStateMachine = false;
 
   MediaResource* resource = mResource;
   NS_ENSURE_TRUE_VOID(resource);
 
   switch (mState) {
-    case DECODER_STATE_SHUTDOWN:
-    case DECODER_STATE_DORMANT:
-    case DECODER_STATE_WAIT_FOR_CDM:
-    case DECODER_STATE_DECODING_METADATA:
-    case DECODER_STATE_DECODING_FIRSTFRAME:
-      return;
-
     case DECODER_STATE_DECODING: {
       if (mPlayState != MediaDecoder::PLAY_STATE_PLAYING && IsPlaying())
       {
         // We're playing, but the element/decoder is in paused state. Stop
         // playing!
         StopPlayback();
       }
 
@@ -2343,20 +2336,16 @@ MediaDecoderStateMachine::RunStateMachin
       DECODER_LOG("Changed state from BUFFERING to DECODING");
       DECODER_LOG("Buffered for %.3lfs", (now - mBufferingStart).ToSeconds());
       SetState(DECODER_STATE_DECODING);
 
       NS_ASSERTION(IsStateMachineScheduled(), "Must have timer scheduled");
       return;
     }
 
-    case DECODER_STATE_SEEKING: {
-      return;
-    }
-
     case DECODER_STATE_COMPLETED: {
       if (mPlayState != MediaDecoder::PLAY_STATE_PLAYING && IsPlaying()) {
         StopPlayback();
       }
       // Play the remaining media. We want to run AdvanceFrame() at least
       // once to ensure the current playback position is advanced to the
       // end of the media, and so that we update the readyState.
       if ((HasVideo() && !mVideoCompleted) ||
@@ -2389,16 +2378,19 @@ MediaDecoderStateMachine::RunStateMachin
         mSentPlaybackEndedEvent = true;
 
         // MediaSink::GetEndTime() must be called before stopping playback.
         StopMediaSink();
       }
 
       return;
     }
+
+    default:
+      return;
   }
 }
 
 void
 MediaDecoderStateMachine::Reset(TrackSet aTracks)
 {
   MOZ_ASSERT(OnTaskQueue());
   DECODER_LOG("MediaDecoderStateMachine::Reset");