Bug 1399760. P1 - remove the CopySegmentToCache() member function. draft
authorJW Wang <jwwang@mozilla.com>
Thu, 14 Sep 2017 11:07:00 +0800
changeset 666823 6e81842faab0def555dfbc130aa92bfdedef9d1a
parent 666189 9b140bb729b974f0146c25704c09173ce63a0de2
child 666824 ee1b60d2f0f859fd4de578b2aa699cb016a8322e
push id80502
push userjwwang@mozilla.com
push dateTue, 19 Sep 2017 07:13:04 +0000
bugs1399760
milestone57.0a1
Bug 1399760. P1 - remove the CopySegmentToCache() member function. MozReview-Commit-ID: 3D9RiK3PJUf
dom/media/MediaResource.cpp
dom/media/MediaResource.h
--- a/dom/media/MediaResource.cpp
+++ b/dom/media/MediaResource.cpp
@@ -431,35 +431,27 @@ ChannelMediaResource::OnChannelRedirect(
                                         int64_t aOffset)
 {
   mChannel = aNew;
   mSuspendAgent.NotifyChannelOpened(mChannel);
   return SetupChannelHeaders(aOffset);
 }
 
 nsresult
-ChannelMediaResource::CopySegmentToCache(const char* aFromSegment,
-                                         uint32_t aCount,
-                                         uint32_t* aWriteCount)
-{
-  mCacheStream.NotifyDataReceived(aCount, aFromSegment);
-  *aWriteCount = aCount;
-  return NS_OK;
-}
-
-nsresult
 ChannelMediaResource::CopySegmentToCache(nsIInputStream* aInStream,
                                          void* aResource,
                                          const char* aFromSegment,
                                          uint32_t aToOffset,
                                          uint32_t aCount,
                                          uint32_t* aWriteCount)
 {
   ChannelMediaResource* res = static_cast<ChannelMediaResource*>(aResource);
-  return res->CopySegmentToCache(aFromSegment, aCount, aWriteCount);
+  res->mCacheStream.NotifyDataReceived(aCount, aFromSegment);
+  *aWriteCount = aCount;
+  return NS_OK;
 }
 
 nsresult
 ChannelMediaResource::OnDataAvailable(nsIRequest* aRequest,
                                       nsIInputStream* aStream,
                                       uint32_t aCount)
 {
   // This might happen off the main thread.
--- a/dom/media/MediaResource.h
+++ b/dom/media/MediaResource.h
@@ -566,20 +566,16 @@ protected:
 
   static nsresult CopySegmentToCache(nsIInputStream* aInStream,
                                      void* aResource,
                                      const char* aFromSegment,
                                      uint32_t aToOffset,
                                      uint32_t aCount,
                                      uint32_t* aWriteCount);
 
-  nsresult CopySegmentToCache(const char* aFromSegment,
-                              uint32_t aCount,
-                              uint32_t* aWriteCount);
-
   // Main thread access only
   RefPtr<Listener> mListener;
   // When this flag is set, if we get a network error we should silently
   // reopen the stream.
   bool               mReopenOnError;
 
   // Any thread access
   MediaCacheStream mCacheStream;