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

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

Issue 858693002: Add MediaKeySession.keystatuseschange event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: WebData Created 5 years, 11 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
Index: Source/modules/encryptedmedia/MediaKeySession.cpp
diff --git a/Source/modules/encryptedmedia/MediaKeySession.cpp b/Source/modules/encryptedmedia/MediaKeySession.cpp
index 4215ba392aa3d2dfdf5985afa6177cb3b636017f..e2a9736cdc20983c71737497ec9b9601692f14a3 100644
--- a/Source/modules/encryptedmedia/MediaKeySession.cpp
+++ b/Source/modules/encryptedmedia/MediaKeySession.cpp
@@ -47,6 +47,7 @@
#include "public/platform/WebContentDecryptionModule.h"
#include "public/platform/WebContentDecryptionModuleException.h"
#include "public/platform/WebContentDecryptionModuleSession.h"
+#include "public/platform/WebEncryptedMediaKeyInformation.h"
#include "public/platform/WebString.h"
#include "public/platform/WebURL.h"
#include "wtf/ASCIICType.h"
@@ -855,6 +856,21 @@ void MediaKeySession::expirationChanged(double updatedExpiryTimeInMS)
m_expiration = updatedExpiryTimeInMS;
}
+void MediaKeySession::keysStatusesChange(const WebVector<WebEncryptedMediaKeyInformation>& keys, bool hasAdditionalUsableKey)
+{
+ WTF_LOG(Media, "MediaKeySession(%p)::keysChange with %zu keys and usable key: %d", this, keys.size(), hasAdditionalUsableKey);
+
+ RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::keystatuseschange);
+ event->setTarget(this);
+ m_asyncEventQueue->enqueueEvent(event.release());
+
+ // FIXME: Attempt to resume playback if |hasAdditionalUsableKey| is true.
+ // http://crbug.com/413413
+
+ // FIXME: Copy |keys| or whatever is necessary for the keyStatuses attribute.
+ // http://crbug.com/432671
+}
+
const AtomicString& MediaKeySession::interfaceName() const
{
return EventTargetNames::MediaKeySession;

Powered by Google App Engine
This is Rietveld 408576698