Backed out changeset c8013b27a0fa (bug 1239899) for failing W(2). r=backout

This commit is contained in:
Sebastian Hengst
2016-01-29 00:32:51 +01:00
parent 132b8bc608
commit f41ca277c9
5 changed files with 31 additions and 11 deletions

View File

@@ -2714,21 +2714,18 @@ HTMLMediaElement::ReportMSETelemetry()
void HTMLMediaElement::UnbindFromTree(bool aDeep,
bool aNullParent)
{
RefPtr<HTMLMediaElement> self(this);
nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction([self]() {
if (self->IsInDoc() || self->mNetworkState == nsIDOMHTMLMediaElement::NETWORK_EMPTY) {
return;
}
self->Pause();
if (self->mDecoder) {
self->mDecoder->NotifyOwnerActivityChanged();
}
});
RunInStableState(task);
if (!mPaused && mNetworkState != nsIDOMHTMLMediaElement::NETWORK_EMPTY) {
Pause();
}
mElementInTreeState = ELEMENT_NOT_INTREE_HAD_INTREE;
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
if (mDecoder) {
MOZ_ASSERT(IsHidden());
mDecoder->NotifyOwnerActivityChanged();
}
}
/* static */