Bug 1300956. Part 2 - Implement WaitForCDMState. r=kaku
authorJW Wang <jwwang@mozilla.com>
Tue, 06 Sep 2016 11:05:03 +0800
changeset 354470 782c54cd404f894cdd1f101fb5a7b1648f29baa9
parent 354469 b867d9ef5e6417e26085eb19654b9e8c7ca0a512
child 354471 174da142669cd40e4c4f7cb15ef7c538ce8541af
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku
bugs1300956
milestone51.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 1300956. Part 2 - Implement WaitForCDMState. r=kaku MozReview-Commit-ID: 7jzwgWxqYKL
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -234,16 +234,28 @@ public:
   }
 
   State GetState() const override
   {
     return DECODER_STATE_DECODING_METADATA;
   }
 };
 
+class MediaDecoderStateMachine::WaitForCDMState
+  : public MediaDecoderStateMachine::StateObject
+{
+public:
+  explicit WaitForCDMState(Master* aPtr) : StateObject(aPtr) {}
+
+  State GetState() const override
+  {
+    return DECODER_STATE_WAIT_FOR_CDM;
+  }
+};
+
 #define INIT_WATCHABLE(name, val) \
   name(val, "MediaDecoderStateMachine::" #name)
 #define INIT_MIRROR(name, val) \
   name(mTaskQueue, val, "MediaDecoderStateMachine::" #name " (Mirror)")
 #define INIT_CANONICAL(name, val) \
   name(mTaskQueue, val, "MediaDecoderStateMachine::" #name " (Canonical)")
 
 MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
@@ -1101,16 +1113,19 @@ MediaDecoderStateMachine::SetState(State
 
   ExitState();
   mState = aState;
 
   switch (mState) {
     case DECODER_STATE_DECODING_METADATA:
       mStateObj = MakeUnique<DecodeMetadataState>(this);
       break;
+    case DECODER_STATE_WAIT_FOR_CDM:
+      mStateObj = MakeUnique<WaitForCDMState>(this);
+      break;
     default:
       mStateObj = nullptr;
       break;
   }
 
   EnterState();
 }