Bug 1398659. P12 - remove unused MediaCacheStream::mHasHadUpdate. draft
authorJW Wang <jwwang@mozilla.com>
Fri, 08 Sep 2017 15:46:53 +0800
changeset 662188 e535e8d25f2af6d9deea316c74721984371fd56f
parent 662187 cac920ecb1f90d2249d79db7268861fa745ab933
child 662221 260959ac942557a3528306d4b62fe2e11ce787c5
push id78979
push userjwwang@mozilla.com
push dateMon, 11 Sep 2017 05:57:05 +0000
bugs1398659
milestone57.0a1
Bug 1398659. P12 - remove unused MediaCacheStream::mHasHadUpdate. MozReview-Commit-ID: 98Nhi924Jip
dom/media/MediaCache.cpp
dom/media/MediaCache.h
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -445,17 +445,16 @@ MediaCacheFlusher::Observe(nsISupports *
   }
   return NS_OK;
 }
 
 MediaCacheStream::MediaCacheStream(ChannelMediaResource* aClient,
                                    bool aIsPrivateBrowsing)
   : mMediaCache(nullptr)
   , mClient(aClient)
-  , mHasHadUpdate(false)
   , mClosed(false)
   , mDidNotifyDataEnded(false)
   , mResourceID(0)
   , mIsTransportSeekable(false)
   , mCacheSuspended(false)
   , mChannelEnded(false)
   , mChannelOffset(0)
   , mStreamLength(-1)
@@ -1421,17 +1420,16 @@ MediaCache::Update()
       stream->mCacheSuspended = false;
       break;
     case SUSPEND:
       stream->mCacheSuspended = true;
       break;
     default:
       break;
     }
-    stream->mHasHadUpdate = true;
   }
 
   for (uint32_t i = 0; i < mStreams.Length(); ++i) {
     MediaCacheStream* stream = mStreams[i];
     nsresult rv;
     switch (actions[i]) {
     case SEEK:
 	case SEEK_AND_RESUME:
--- a/dom/media/MediaCache.h
+++ b/dom/media/MediaCache.h
@@ -429,19 +429,16 @@ private:
   bool UpdatePrincipal(nsIPrincipal* aPrincipal);
 
   // Instance of MediaCache to use with this MediaCacheStream.
   RefPtr<MediaCache> mMediaCache;
 
   // These fields are main-thread-only.
   ChannelMediaResource*  mClient;
   nsCOMPtr<nsIPrincipal> mPrincipal;
-  // Set to true when MediaCache::Update() has finished while this stream
-  // was present.
-  bool                   mHasHadUpdate;
   // Set to true when the stream has been closed either explicitly or
   // due to an internal cache error
   bool                   mClosed;
   // True if CacheClientNotifyDataEnded has been called for this stream.
   bool                   mDidNotifyDataEnded;
 
   // The following fields must be written holding the cache's monitor and
   // only on the main thread, thus can be read either on the main thread