Bug 1368837 - MockMediaResource::GetCachedDataEnd should return the offset if out of range - r=cpearce
authorGerald Squelart <gsquelart@mozilla.com>
Mon, 29 May 2017 15:13:15 +1200
changeset 361718 a341e170f306d01a9ade7eba3158edfe1c50995c
parent 361717 d7836ae27b65d4e511d3bf047380e1fb83124002
child 361719 2f9a486c2dbbfce70a97ea9ae2832ed9fac0f266
push id31939
push usercbook@mozilla.com
push dateThu, 01 Jun 2017 11:49:28 +0000
treeherdermozilla-central@d96110d76619 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1368837
milestone55.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 1368837 - MockMediaResource::GetCachedDataEnd should return the offset if out of range - r=cpearce If the requested cached-data offset is out of range, we should just return the same offset, as it signals that the actual cached range is 0 bytes, without having to deal with -1. MozReview-Commit-ID: D0rXO0S0mss
dom/media/gtest/MockMediaResource.cpp
--- a/dom/media/gtest/MockMediaResource.cpp
+++ b/dom/media/gtest/MockMediaResource.cpp
@@ -99,17 +99,17 @@ MockMediaResource::GetNextCachedData(int
 int64_t
 MockMediaResource::GetCachedDataEnd(int64_t aOffset)
 {
   for (size_t i = 0; i < mRanges.Length(); i++) {
     if (aOffset == mRanges[i].mStart) {
       return mRanges[i].mEnd;
     }
   }
-  return -1;
+  return aOffset;
 }
 
 nsresult
 MockMediaResource::GetCachedRanges(MediaByteRangeSet& aRanges)
 {
   aRanges = mRanges;
   return NS_OK;
 }