Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1499)

Unified Diff: Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp

Issue 1174173002: Remove check before clearing MediaKeys (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
diff --git a/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp b/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
index cfd1fd8a0e40707c19053d5192fb7ccdb2358fc8..e998d7df349128f3f308d77d935fbe453366c8bc 100644
--- a/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
+++ b/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
@@ -177,23 +177,18 @@ void SetMediaKeysHandler::clearExistingMediaKeys()
// 3.2 If the mediaKeys attribute is not null, run the following steps:
if (thisElement.m_mediaKeys) {
- // 3.2.1 If the user agent or CDM do not support removing the
- // association, return a promise rejected with a new DOMException
- // whose name is "NotSupportedError".
- // (supported by blink).
- // 3.2.2 If the association cannot currently be removed (i.e. during
- // playback), return a promise rejected with a new DOMException
- // whose name is "InvalidStateError".
WebMediaPlayer* mediaPlayer = m_element->webMediaPlayer();
if (mediaPlayer) {
- if (!mediaPlayer->paused()) {
- fail(InvalidStateError, "The existing MediaKeys object cannot be removed while a media resource is playing.");
- return;
- }
-
+ // 3.2.1 If the user agent or CDM do not support removing the
+ // association, return a promise rejected with a new
+ // DOMException whose name is "NotSupportedError".
+ // 3.2.2 If the association cannot currently be removed (i.e.
+ // during playback), return a promise rejected with a new
+ // DOMException whose name is "InvalidStateError".
// 3.2.3 Stop using the CDM instance represented by the mediaKeys
// attribute to decrypt media data and remove the association
// with the media element.
+ // (All 3 steps handled as needed in Chromium.)
OwnPtr<SuccessCallback> successCallback = bind(&SetMediaKeysHandler::setNewMediaKeys, this);
OwnPtr<FailureCallback> failureCallback = bind<ExceptionCode, const String&>(&SetMediaKeysHandler::clearFailed, this);
ContentDecryptionModuleResult* result = new SetContentDecryptionModuleResult(successCallback.release(), failureCallback.release());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698