mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-29 18:53:15 +00:00
import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1184429: P1. Don't dispatch NotifyDataArrived if previously dispatched with same range. r=jwwang (23c800ae85) - partial of Bug 1184429: P2. MediaResource::SilentReadAt to read from cache first. r=jwwang (8cee1efb46) - Bug 1173463 - Add MediaResource::GetContentURL(). r=cpearce (a204aeff0a) - Bug 1142455 - Tweak MediaCache parameters. r=roc (a3ded56f74)
This commit is contained in:
@@ -432,6 +432,8 @@ private:
|
|||||||
// MediaByteBuffer is a ref counted infallible TArray.
|
// MediaByteBuffer is a ref counted infallible TArray.
|
||||||
class MediaByteBuffer : public nsTArray<uint8_t> {
|
class MediaByteBuffer : public nsTArray<uint8_t> {
|
||||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaByteBuffer);
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaByteBuffer);
|
||||||
|
MediaByteBuffer() = default;
|
||||||
|
explicit MediaByteBuffer(size_t aCapacity) : nsTArray<uint8_t>(aCapacity) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
~MediaByteBuffer() {}
|
~MediaByteBuffer() {}
|
||||||
|
|||||||
@@ -192,6 +192,8 @@ MediaDecoderReader::ThrottledNotifyDataArrived(const Interval<int64_t>& aInterva
|
|||||||
|
|
||||||
if (mThrottledInterval.isNothing()) {
|
if (mThrottledInterval.isNothing()) {
|
||||||
mThrottledInterval.emplace(aInterval);
|
mThrottledInterval.emplace(aInterval);
|
||||||
|
} else if (mThrottledInterval.ref().Contains(aInterval)) {
|
||||||
|
return;
|
||||||
} else if (!mThrottledInterval.ref().Contiguous(aInterval)) {
|
} else if (!mThrottledInterval.ref().Contiguous(aInterval)) {
|
||||||
DoThrottledNotify();
|
DoThrottledNotify();
|
||||||
mThrottledInterval.emplace(aInterval);
|
mThrottledInterval.emplace(aInterval);
|
||||||
|
|||||||
@@ -25,7 +25,11 @@
|
|||||||
// For HTTP seeking, if number of bytes needing to be
|
// For HTTP seeking, if number of bytes needing to be
|
||||||
// seeked forward is less than this value then a read is
|
// seeked forward is less than this value then a read is
|
||||||
// done rather than a byte range request.
|
// done rather than a byte range request.
|
||||||
static const int64_t SEEK_VS_READ_THRESHOLD = 32*1024;
|
//
|
||||||
|
// If we assume a 100Mbit connection, and assume reissuing an HTTP seek causes
|
||||||
|
// a delay of 200ms, then in that 200ms we could have simply read ahead 2MB. So
|
||||||
|
// setting SEEK_VS_READ_THRESHOLD to 1MB sounds reasonable.
|
||||||
|
static const int64_t SEEK_VS_READ_THRESHOLD = 1 * 1024 * 1024;
|
||||||
|
|
||||||
static const uint32_t HTTP_REQUESTED_RANGE_NOT_SATISFIABLE_CODE = 416;
|
static const uint32_t HTTP_REQUESTED_RANGE_NOT_SATISFIABLE_CODE = 416;
|
||||||
|
|
||||||
@@ -435,6 +439,8 @@ public:
|
|||||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const nsCString& GetContentURL() const { return EmptyCString(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~MediaResource() {};
|
virtual ~MediaResource() {};
|
||||||
|
|
||||||
@@ -467,6 +473,12 @@ public:
|
|||||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns the url of the resource. Safe to call from any thread?
|
||||||
|
const nsCString& GetContentURL() const
|
||||||
|
{
|
||||||
|
return mContentURL;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BaseMediaResource(MediaDecoder* aDecoder,
|
BaseMediaResource(MediaDecoder* aDecoder,
|
||||||
nsIChannel* aChannel,
|
nsIChannel* aChannel,
|
||||||
@@ -480,6 +492,7 @@ protected:
|
|||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(BaseMediaResource);
|
MOZ_COUNT_CTOR(BaseMediaResource);
|
||||||
NS_ASSERTION(!mContentType.IsEmpty(), "Must know content type");
|
NS_ASSERTION(!mContentType.IsEmpty(), "Must know content type");
|
||||||
|
mURI->GetSpec(mContentURL);
|
||||||
}
|
}
|
||||||
virtual ~BaseMediaResource()
|
virtual ~BaseMediaResource()
|
||||||
{
|
{
|
||||||
@@ -518,6 +531,9 @@ protected:
|
|||||||
// is safe.
|
// is safe.
|
||||||
const nsAutoCString mContentType;
|
const nsAutoCString mContentType;
|
||||||
|
|
||||||
|
// Copy of the url of the channel resource.
|
||||||
|
nsAutoCString mContentURL;
|
||||||
|
|
||||||
// True if SetLoadInBackground() has been called with
|
// True if SetLoadInBackground() has been called with
|
||||||
// aLoadInBackground = true, i.e. when the document load event is not
|
// aLoadInBackground = true, i.e. when the document load event is not
|
||||||
// blocked by this resource, and all channel loads will be in the
|
// blocked by this resource, and all channel loads will be in the
|
||||||
|
|||||||
Reference in New Issue
Block a user