Bug 1310140. Part 1 - add StateObject::HandleVideoSuspendTimeout(). r=kaku,kamidphish
authorJW Wang <jwwang@mozilla.com>
Tue, 18 Oct 2016 10:29:14 +0800
changeset 318565 13bdbcb9078d10bf89d239e64dcecccf90b757c3
parent 318564 e2511b7cd8d98cb9b4df844d439b9550bb357afc
child 318566 abbb1e22b2c160ad87c7eab07fb2884d1f98b318
push id82960
push usercbook@mozilla.com
push dateWed, 19 Oct 2016 15:04:04 +0000
treeherdermozilla-inbound@c48c53e3492e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku, kamidphish
bugs1310140
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1310140. Part 1 - add StateObject::HandleVideoSuspendTimeout(). r=kaku,kamidphish MozReview-Commit-ID: 1qyDJzogSR8
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -210,16 +210,23 @@ public:
   virtual bool HandleWaitingForData() { return false; }
 
   virtual RefPtr<MediaDecoder::SeekPromise> HandleSeek(SeekTarget aTarget) = 0;
 
   virtual bool HandleAudioCaptured() { return false; }
 
   virtual RefPtr<ShutdownPromise> HandleShutdown();
 
+  virtual void HandleVideoSuspendTimeout()
+  {
+    mMaster->mVideoDecodeSuspended = true;
+    mMaster->mOnPlaybackEvent.Notify(MediaEventType::EnterVideoSuspend);
+    Reader()->SetVideoBlankDecode(true);
+  }
+
   virtual void DumpDebugInfo() {}
 
 protected:
   using Master = MediaDecoderStateMachine;
   explicit StateObject(Master* aPtr) : mMaster(aPtr) {}
   TaskQueue* OwnerThread() const { return mMaster->mTaskQueue; }
   MediaResource* Resource() const { return mMaster->mResource; }
   MediaDecoderReaderWrapper* Reader() const { return mMaster->mReader; }
@@ -3228,19 +3235,17 @@ MediaDecoderStateMachine::VideoRequestSt
   return "idle";
 }
 
 void
 MediaDecoderStateMachine::OnSuspendTimerResolved()
 {
   DECODER_LOG("OnSuspendTimerResolved");
   mVideoDecodeSuspendTimer.CompleteRequest();
-  mVideoDecodeSuspended = true;
-  mOnPlaybackEvent.Notify(MediaEventType::EnterVideoSuspend);
-  mReader->SetVideoBlankDecode(true);
+  mStateObj->HandleVideoSuspendTimeout();
 }
 
 void
 MediaDecoderStateMachine::OnSuspendTimerRejected()
 {
   DECODER_LOG("OnSuspendTimerRejected");
   MOZ_ASSERT(OnTaskQueue());
   MOZ_ASSERT(!mVideoDecodeSuspended);