Bug 1314524. Part 2 - devirtualize StateObject::HandleDormant(). r=kaku
authorJW Wang <jwwang@mozilla.com>
Fri, 28 Oct 2016 16:02:11 +0800
changeset 351537 5e7a0cfc6d9c63d17e31666a1876060483a1c1fe
parent 351536 53e37c0bc34bed6f6257b66d1e3be446d91e8014
child 351538 16b66da551806a3a7d0b9006d20a665e5297c678
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)
reviewerskaku
bugs1314524
milestone52.0a1
Bug 1314524. Part 2 - devirtualize StateObject::HandleDormant(). r=kaku MozReview-Commit-ID: D99L6Ioy6PJ
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -189,17 +189,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 HandleDormant(bool aDormant);
+  bool HandleDormant(bool aDormant);
 
   virtual bool HandleCDMProxyReady() { return false; }
 
   virtual bool HandleAudioDecoded(MediaData* aAudio) { return false; }
 
   virtual bool HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart)
   {
     return false;
@@ -313,17 +313,17 @@ public:
     mMetadataRequest.DisconnectIfExists();
   }
 
   State GetState() const override
   {
     return DECODER_STATE_DECODING_METADATA;
   }
 
-  bool HandleDormant(bool aDormant) override
+  bool HandleDormant(bool aDormant)
   {
     mPendingDormant = aDormant;
     return true;
   }
 
   RefPtr<MediaDecoder::SeekPromise> HandleSeek(SeekTarget aTarget) override
   {
     MOZ_DIAGNOSTIC_ASSERT(false, "Can't seek while decoding metadata.");
@@ -385,17 +385,17 @@ public:
     mPendingSeek.RejectIfExists(__func__);
   }
 
   State GetState() const override
   {
     return DECODER_STATE_WAIT_FOR_CDM;
   }
 
-  bool HandleDormant(bool aDormant) override;
+  bool HandleDormant(bool aDormant);
 
   bool 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;
@@ -448,17 +448,17 @@ public:
     mPendingSeek.RejectIfExists(__func__);
   }
 
   State GetState() const override
   {
     return DECODER_STATE_DORMANT;
   }
 
-  bool HandleDormant(bool aDormant) override;
+  bool HandleDormant(bool aDormant);
 
   RefPtr<MediaDecoder::SeekPromise> HandleSeek(SeekTarget aTarget) override;
 
   void HandleVideoSuspendTimeout() override
   {
     // Do nothing since we've released decoders in Enter().
   }
 
@@ -525,17 +525,17 @@ public:
   bool HandleEndOfStream() override
   {
     MaybeFinishDecodeFirstFrame();
     return true;
   }
 
   RefPtr<MediaDecoder::SeekPromise> HandleSeek(SeekTarget aTarget) override;
 
-  bool HandleDormant(bool aDormant) override;
+  bool HandleDormant(bool aDormant);
 
   void HandleVideoSuspendTimeout() override
   {
     // Do nothing for we need to decode the 1st video frame to get the dimensions.
   }
 
   void HandleResumeVideoDecoding() override
   {
@@ -866,17 +866,17 @@ public:
     mMaster->SetMediaDecoderReaderWrapperCallback();
   }
 
   State GetState() const override
   {
     return DECODER_STATE_SEEKING;
   }
 
-  bool HandleDormant(bool aDormant) override;
+  bool HandleDormant(bool aDormant);
 
   bool HandleAudioDecoded(MediaData* aAudio) override
   {
     MOZ_ASSERT(false);
     return true;
   }
 
   bool HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart) override
@@ -1148,17 +1148,17 @@ public:
     MOZ_DIAGNOSTIC_ASSERT(false, "Shouldn't escape the SHUTDOWN state.");
   }
 
   State GetState() const override
   {
     return DECODER_STATE_SHUTDOWN;
   }
 
-  bool HandleDormant(bool aDormant) override
+  bool HandleDormant(bool aDormant)
   {
     return true;
   }
 
   RefPtr<MediaDecoder::SeekPromise> HandleSeek(SeekTarget aTarget) override
   {
     MOZ_DIAGNOSTIC_ASSERT(false, "Can't seek in shutdown state.");
     return MediaDecoder::SeekPromise::CreateAndReject(true, __func__);