Bug 1369548 - HTMLMediaElement::SetMediaKeys should continue working even the decoder is shutting down. r=cpearce

The MediaKeys status inside a HTMLME cannot be reflected correctly if the mSetCDMRequest is disconnected in HTMLME::ShutdownDecoder.
This may happen when a page calls load() or sets new src right after setting MediaKeys to null.

MozReview-Commit-ID: 3BZOmw7BNFO
This commit is contained in:
Kilik Kuo
2017-11-15 12:32:50 +08:00
parent 034522a19a
commit cd46825275

View File

@@ -1723,7 +1723,7 @@ void HTMLMediaElement::ShutdownDecoder()
{
RemoveMediaElementFromURITable();
NS_ASSERTION(mDecoder, "Must have decoder to shut down");
mSetCDMRequest.DisconnectIfExists();
mWaitingForKeyListener.DisconnectIfExists();
if (mMediaSource) {
mMediaSource->CompletePendingTransactions();
@@ -4064,6 +4064,8 @@ HTMLMediaElement::~HTMLMediaElement()
mVideoFrameContainer->ForgetElement();
}
UnregisterActivityObserver();
mSetCDMRequest.DisconnectIfExists();
if (mDecoder) {
ShutdownDecoder();
}