Bug 1423465. P1 - expose MDSM::OwnerThread() to the public. draft
authorJW Wang <jwwang@mozilla.com>
Tue, 05 Dec 2017 11:03:34 +0800
changeset 708105 b95036f19423023f38f6e69486e921a66811fa27
parent 708103 be9ecb4cc04b21665d8d25bdd44c25a06f26aa6d
child 708106 473f20c792461f62f268beb61ea0ea1420d27c16
push id92287
push userjwwang@mozilla.com
push dateWed, 06 Dec 2017 07:32:57 +0000
bugs1423465
milestone59.0a1
Bug 1423465. P1 - expose MDSM::OwnerThread() to the public. This will be used by ChannelMediaDecoder to run some code off the main thread. MozReview-Commit-ID: 7Ecej11GBvy
dom/media/MediaDecoderStateMachine.h
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -188,16 +188,19 @@ public:
     DECODER_STATE_DECODING_FIRSTFRAME,
     DECODER_STATE_DECODING,
     DECODER_STATE_SEEKING,
     DECODER_STATE_BUFFERING,
     DECODER_STATE_COMPLETED,
     DECODER_STATE_SHUTDOWN
   };
 
+  // Returns the state machine task queue.
+  TaskQueue* OwnerThread() const { return mTaskQueue; }
+
   RefPtr<MediaDecoder::DebugInfoPromise> RequestDebugInfo();
 
   void AddOutputStream(ProcessedMediaStream* aStream, bool aFinishWhenEnded);
   // Remove an output stream added with AddOutputStream.
   void RemoveOutputStream(MediaStream* aStream);
 
   // Seeks to the decoder to aTarget asynchronously.
   RefPtr<MediaDecoder::SeekPromise> InvokeSeek(const SeekTarget& aTarget);
@@ -329,19 +332,16 @@ private:
   // Only called on the decoder thread. Must be called with
   // the decode monitor held.
   void UpdatePlaybackPosition(const media::TimeUnit& aTime);
 
   bool HasAudio() const { return mInfo.ref().HasAudio(); }
   bool HasVideo() const { return mInfo.ref().HasVideo(); }
   const MediaInfo& Info() const { return mInfo.ref(); }
 
-  // Returns the state machine task queue.
-  TaskQueue* OwnerThread() const { return mTaskQueue; }
-
   // Schedules the shared state machine thread to run the state machine.
   void ScheduleStateMachine();
 
   // Invokes ScheduleStateMachine to run in |aTime|,
   // unless it's already scheduled to run earlier, in which case the
   // request is discarded.
   void ScheduleStateMachineIn(const media::TimeUnit& aTime);