Bug 1314526. Part 1 - fix HandleCDMProxyReady(). r=kikuo
authorJW Wang <jwwang@mozilla.com>
Fri, 28 Oct 2016 16:25:44 +0800
changeset 351545 5d5799848acf017b982b8febf15a9ca154a09473
parent 351544 3d0b7a58598b324fd0e72a72aa6e800d69e5521f
child 351546 30ab9b36441b43942cbc685f5e4ee4cd67163d80
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskikuo
bugs1314526
milestone52.0a1
Bug 1314526. Part 1 - fix HandleCDMProxyReady(). r=kikuo MozReview-Commit-ID: 9PyeBUXadud
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -188,18 +188,17 @@ class MediaDecoderStateMachine::StateObj
 {
 public:
   virtual ~StateObject() {}
   virtual void Exit() {};  // Exit action.
   virtual void Step() {}   // Perform a 'cycle' of this state object.
   virtual State GetState() const = 0;
 
   // Event handlers for various events.
-  // Return true if the event is handled by this state object.
-  virtual bool HandleCDMProxyReady() { return false; }
+  virtual void HandleCDMProxyReady() {}
 
   virtual bool HandleAudioDecoded(MediaData* aAudio) { return false; }
 
   virtual bool HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart)
   {
     return false;
   }
 
@@ -369,17 +368,17 @@ public:
     mPendingSeek.RejectIfExists(__func__);
   }
 
   State GetState() const override
   {
     return DECODER_STATE_WAIT_FOR_CDM;
   }
 
-  bool HandleCDMProxyReady() override;
+  void HandleCDMProxyReady() override;
 
   RefPtr<MediaDecoder::SeekPromise> HandleSeek(SeekTarget aTarget) override
   {
     SLOG("Not Enough Data to seek at this stage, queuing seek");
     mPendingSeek.RejectIfExists(__func__);
     mPendingSeek.mTarget = aTarget;
     return mPendingSeek.mPromise.Ensure(__func__);
   }
@@ -1312,22 +1311,21 @@ DormantState::HandlePlayStateChanged(Med
 {
   if (aPlayState == MediaDecoder::PLAY_STATE_PLAYING) {
     // Exit dormant when the user wants to play.
     MOZ_ASSERT(!Info().IsEncrypted() || mMaster->mCDMProxy);
     SetState<DecodingFirstFrameState>(Move(mPendingSeek));
   }
 }
 
-bool
+void
 MediaDecoderStateMachine::
 WaitForCDMState::HandleCDMProxyReady()
 {
   SetState<DecodingFirstFrameState>(Move(mPendingSeek));
-  return true;
 }
 
 void
 MediaDecoderStateMachine::
 DecodingFirstFrameState::Enter(SeekJob aPendingSeek)
 {
   // Handle pending seek.
   if (aPendingSeek.Exists() &&