bug 975782 bring media resource loads out of background while they delay the load event r=cpearce

This will happen after a stalled load doesn't delay the load event but such a
load then delays the load event again when it receives progress.
This commit is contained in:
Karl Tomlinson
2014-12-23 14:16:05 +13:00
parent 864879916b
commit 73ceb72c48
5 changed files with 33 additions and 26 deletions

View File

@@ -3752,15 +3752,14 @@ void HTMLMediaElement::ChangeDelayLoadStatus(bool aDelay)
mDelayingLoadEvent = aDelay;
LOG(PR_LOG_DEBUG, ("%p ChangeDelayLoadStatus(%d) doc=0x%p", this, aDelay, mLoadBlockedDoc.get()));
if (mDecoder) {
mDecoder->SetLoadInBackground(!aDelay);
}
if (aDelay) {
mLoadBlockedDoc = OwnerDoc();
mLoadBlockedDoc->BlockOnload();
LOG(PR_LOG_DEBUG, ("%p ChangeDelayLoadStatus(%d) doc=0x%p", this, aDelay, mLoadBlockedDoc.get()));
} else {
if (mDecoder) {
mDecoder->MoveLoadsToBackground();
}
LOG(PR_LOG_DEBUG, ("%p ChangeDelayLoadStatus(%d) doc=0x%p", this, aDelay, mLoadBlockedDoc.get()));
// mLoadBlockedDoc might be null due to GC unlinking
if (mLoadBlockedDoc) {
mLoadBlockedDoc->UnblockOnload(false);