Bug 1273063 - remove ChannelMediaResource::mIsTransportSeekable. r=cpearce.
MozReview-Commit-ID: DvBaIzbh72D
--- a/dom/media/MediaResource.cpp
+++ b/dom/media/MediaResource.cpp
@@ -70,17 +70,16 @@ ChannelMediaResource::ChannelMediaResour
const nsACString& aContentType)
: BaseMediaResource(aCallback, aChannel, aURI, aContentType),
mOffset(0),
mReopenOnError(false),
mIgnoreClose(false),
mCacheStream(this),
mLock("ChannelMediaResource.mLock"),
mIgnoreResume(false),
- mIsTransportSeekable(true),
mSuspendAgent(mChannel)
{
}
ChannelMediaResource::~ChannelMediaResource()
{
if (mListener) {
// Kill its reference to us since we're going away
@@ -292,17 +291,16 @@ ChannelMediaResource::OnStartRequest(nsI
}
mCallback->SetInfinite(!dataIsBounded);
}
mCacheStream.SetTransportSeekable(seekable);
{
MutexAutoLock lock(mLock);
- mIsTransportSeekable = seekable;
mChannelStatistics->Start();
}
mReopenOnError = false;
mIgnoreClose = false;
mSuspendAgent.UpdateSuspendedStatusIfNeeded();
@@ -310,18 +308,17 @@ ChannelMediaResource::OnStartRequest(nsI
owner->DownloadProgressed();
return NS_OK;
}
bool
ChannelMediaResource::IsTransportSeekable()
{
- MutexAutoLock lock(mLock);
- return mIsTransportSeekable;
+ return mCacheStream.IsTransportSeekable();
}
nsresult
ChannelMediaResource::ParseContentRangeHeader(nsIHttpChannel * aHttpChan,
int64_t& aRangeStart,
int64_t& aRangeEnd,
int64_t& aRangeTotal)
{
--- a/dom/media/MediaResource.h
+++ b/dom/media/MediaResource.h
@@ -695,20 +695,16 @@ protected:
Mutex mLock;
RefPtr<MediaChannelStatistics> mChannelStatistics;
// True if we couldn't suspend the stream and we therefore don't want
// to resume later. This is usually due to the channel not being in the
// isPending state at the time of the suspend request.
bool mIgnoreResume;
- // True if the stream can seek into unbuffered ranged, i.e. if the
- // connection supports byte range requests.
- bool mIsTransportSeekable;
-
ChannelSuspendAgent mSuspendAgent;
};
/**
* RAII class that handles pinning and unpinning for MediaResource and derived.
* This should be used when making calculations that involve potentially-cached
* MediaResource data, so that the state of the world can't change out from under
* us.