Bug 1450607 - P1. Fix constness. r?gerald
MozReview-Commit-ID: CeftB0qmzTf
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -2440,17 +2440,17 @@ MediaCacheStream::Unpin()
NS_ASSERTION(mPinCount > 0, "Unbalanced Unpin");
--mPinCount;
// Queue an Update since we may be able to read more into the
// cache, if this stream's block have become evictable
mMediaCache->QueueUpdate(lock);
}
int64_t
-MediaCacheStream::GetLength()
+MediaCacheStream::GetLength() const
{
MOZ_ASSERT(!NS_IsMainThread());
AutoLock lock(mMediaCache->Monitor());
return mStreamLength;
}
int64_t
MediaCacheStream::GetNextCachedData(int64_t aOffset)
--- a/dom/media/MediaCache.h
+++ b/dom/media/MediaCache.h
@@ -297,17 +297,17 @@ public:
void Pin();
void Unpin();
// See comments above for NotifyDataStarted about how the length
// can vary over time. Returns -1 if no length is known. Returns the
// reported length if we haven't got any better information. If
// the stream ended normally we return the length we actually got.
// If we've successfully read data beyond the originally reported length,
// we return the end of the data we've read.
- int64_t GetLength();
+ int64_t GetLength() const;
// Returns the unique resource ID. Call only on the main thread or while
// holding the media cache lock.
int64_t GetResourceID() { return mResourceID; }
// Returns the end of the bytes starting at the given offset
// which are in cache.
int64_t GetCachedDataEnd(int64_t aOffset);
// Returns the offset of the first byte of cached data at or after aOffset,
// or -1 if there is no such cached data.