Bug 1378631. P2 - remove AbstractMediaDecoder::CanonicalDurationOrNull(). draft
authorJW Wang <jwwang@mozilla.com>
Thu, 06 Jul 2017 11:38:27 +0800
changeset 606530 762dadbf4ba3988aa8a782f7b909bc9bbb6faf15
parent 606529 d418627d5b1110d8baa6037af7156ccd8ee465c5
child 636782 f223933ebb80805189b09b85ba4adedede5d5818
push id67716
push userjwwang@mozilla.com
push dateTue, 11 Jul 2017 02:00:40 +0000
bugs1378631
milestone56.0a1
Bug 1378631. P2 - remove AbstractMediaDecoder::CanonicalDurationOrNull(). MozReview-Commit-ID: 9zWPcYZndsQ
dom/media/AbstractMediaDecoder.h
dom/media/MediaDecoder.cpp
dom/media/MediaDecoder.h
--- a/dom/media/AbstractMediaDecoder.h
+++ b/dom/media/AbstractMediaDecoder.h
@@ -41,21 +41,16 @@ typedef nsDataHashtable<nsCStringHashKey
 class AbstractMediaDecoder : public nsIObserver
 {
 public:
   // Increments the parsed, decoded and dropped frame counters by the passed in
   // counts.
   // Can be called on any thread.
   virtual void NotifyDecodedFrames(const FrameStatisticsData& aStats) = 0;
 
-  virtual AbstractCanonical<media::NullableTimeUnit>* CanonicalDurationOrNull()
-  {
-    return nullptr;
-  };
-
   // Returns an event that will be notified when the owning document changes state
   // and we might have a new compositor. If this new compositor requires us to
   // recreate our decoders, then we expect the existing decoderis to return an
   // error independently of this.
   virtual MediaEventSource<RefPtr<layers::KnowsCompositor>>*
   CompositorUpdatedEvent()
   {
     return nullptr;
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -192,23 +192,16 @@ MediaDecoder::RemoveOutputStream(MediaSt
 
 double
 MediaDecoder::GetDuration()
 {
   MOZ_ASSERT(NS_IsMainThread());
   return mDuration;
 }
 
-AbstractCanonical<media::NullableTimeUnit>*
-MediaDecoder::CanonicalDurationOrNull()
-{
-  MOZ_ASSERT(mDecoderStateMachine);
-  return mDecoderStateMachine->CanonicalDuration();
-}
-
 void
 MediaDecoder::SetInfinite(bool aInfinite)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
   mInfiniteStream = aInfinite;
   DurationChanged();
 }
--- a/dom/media/MediaDecoder.h
+++ b/dom/media/MediaDecoder.h
@@ -775,17 +775,16 @@ protected:
 
   // Current decoding position in the stream. This is where the decoder
   // is up to consuming the stream. This is not adjusted during decoder
   // seek operations, but it's updated at the end when we start playing
   // back again.
   Canonical<int64_t> mDecoderPosition;
 
 public:
-  AbstractCanonical<media::NullableTimeUnit>* CanonicalDurationOrNull() override;
   AbstractCanonical<double>* CanonicalVolume() { return &mVolume; }
   AbstractCanonical<bool>* CanonicalPreservesPitch()
   {
     return &mPreservesPitch;
   }
   AbstractCanonical<bool>* CanonicalLooping()
   {
     return &mLooping;