зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1377206 - Explicitly disable throttling of media HTTP responses, r=cpearce
--HG-- extra : rebase_source : 01f913c44c7ce02bedd733faaf11262353f3461d
This commit is contained in:
Родитель
62072603a7
Коммит
e372b0a90f
|
@ -1196,14 +1196,19 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIClassOfService> cos;
|
||||
if (aElement->mUseUrgentStartForChannel &&
|
||||
(cos = do_QueryInterface(channel))) {
|
||||
cos->AddClassFlags(nsIClassOfService::UrgentStart);
|
||||
nsCOMPtr<nsIClassOfService> cos(do_QueryInterface(channel));
|
||||
if (cos) {
|
||||
if (aElement->mUseUrgentStartForChannel) {
|
||||
cos->AddClassFlags(nsIClassOfService::UrgentStart);
|
||||
|
||||
// Reset the flag to avoid loading again without initiated by user
|
||||
// interaction.
|
||||
aElement->mUseUrgentStartForChannel = false;
|
||||
// Reset the flag to avoid loading again without initiated by user
|
||||
// interaction.
|
||||
aElement->mUseUrgentStartForChannel = false;
|
||||
}
|
||||
|
||||
// Unconditionally disable throttling since we want the media to fluently
|
||||
// play even when we switch the tab to background.
|
||||
cos->AddClassFlags(nsIClassOfService::DontThrottle);
|
||||
}
|
||||
|
||||
// The listener holds a strong reference to us. This creates a
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "nsDebug.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIClassOfService.h"
|
||||
#include "nsIFile.h"
|
||||
#include "nsIFileChannel.h"
|
||||
#include "nsIFileStreams.h"
|
||||
|
@ -847,6 +848,13 @@ ChannelMediaResource::RecreateChannel()
|
|||
loadFlags);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIClassOfService> cos(do_QueryInterface(mChannel));
|
||||
if (cos) {
|
||||
// Unconditionally disable throttling since we want the media to fluently
|
||||
// play even when we switch the tab to background.
|
||||
cos->AddClassFlags(nsIClassOfService::DontThrottle);
|
||||
}
|
||||
|
||||
mSuspendAgent.NotifyChannelOpened(mChannel);
|
||||
|
||||
// Tell the cache to reset the download status when the channel is reopened.
|
||||
|
|
Загрузка…
Ссылка в новой задаче