Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp (237492 => 237493)
--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp 2018-10-27 14:41:22 UTC (rev 237492)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp 2018-10-27 15:34:35 UTC (rev 237493)
@@ -35,6 +35,7 @@
#include "CDMInstance.h"
#include "Document.h"
#include "EventNames.h"
+#include "Logging.h"
#include "MediaKeyMessageEvent.h"
#include "MediaKeyMessageType.h"
#include "MediaKeyStatusMap.h"
@@ -70,6 +71,8 @@
// W3C Editor's Draft 09 November 2016
// createSession(), ctd.
+ LOG(EME, "EME - new session created");
+
// 3.1. Let the sessionId attribute be the empty string.
// 3.2. Let the expiration attribute be NaN.
// 3.3. Let the closed attribute be a new promise.
@@ -120,6 +123,8 @@
// When this method is invoked, the user agent must run the following steps:
// 1. If this object is closed, return a promise rejected with an InvalidStateError.
// 2. If this object's uninitialized value is false, return a promise rejected with an InvalidStateError.
+ LOG(EME, "EME - generate request");
+
if (m_closed || !m_uninitialized) {
promise->reject(InvalidStateError);
return;
@@ -194,6 +199,7 @@
m_latestDecryptTime = 0;
}
+ LOG(EME, "EME - request license from CDM implementation");
m_instanceSession->requestLicense(m_sessionType, initDataType, WTFMove(initData), [this, weakThis = makeWeakPtr(*this), promise = WTFMove(promise)] (Ref<SharedBuffer>&& message, const String& sessionId, bool needsIndividualization, CDMInstanceSession::SuccessValue succeeded) mutable {
if (!weakThis)
return;
@@ -359,6 +365,8 @@
// When this method is invoked, the user agent must run the following steps:
// 1. If this object is closed, return a promise rejected with an InvalidStateError.
// 2. If this object's callable value is false, return a promise rejected with an InvalidStateError.
+ LOG(EME, "EME - update session for %s", m_sessionId.utf8().data());
+
if (m_closed || !m_callable) {
promise->reject(InvalidStateError);
return;
@@ -415,6 +423,7 @@
// NOTE: Steps 6.7.1. and 6.7.2. should be implemented in CDMInstance.
if (succeeded == CDMInstanceSession::SuccessValue::Failed) {
+ LOG(EME, "EME - failed to update CDM license for %s", m_sessionId.utf8().data());
promise->reject(TypeError);
return;
}
@@ -424,6 +433,7 @@
// 6.7.3.2. Let message type be the appropriate MediaKeyMessageType for the message.
// 6.8. Queue a task to run the following steps:
m_taskQueue.enqueueTask([this, sessionWasClosed, changedKeys = WTFMove(changedKeys), changedExpiration = WTFMove(changedExpiration), message = WTFMove(message), promise = WTFMove(promise)] () mutable {
+ LOG(EME, "EME - updating CDM license succeeded for session %s, sending a message to the license server", m_sessionId.utf8().data());
// 6.8.1.
if (sessionWasClosed) {
// ↳ If session closed is true:
@@ -484,6 +494,8 @@
// 1. Let session be the associated MediaKeySession object.
// 2. If session is closed, return a resolved promise.
+ LOG(EME, "EME - closing session %s", m_sessionId.utf8().data());
+
if (m_closed) {
promise->resolve();
return;
@@ -500,6 +512,7 @@
m_taskQueue.enqueueTask([this, promise = WTFMove(promise)] () mutable {
// 5.1. Let cdm be the CDM instance represented by session's cdm instance value.
// 5.2. Use cdm to close the key session associated with session.
+ LOG(EME, "EME - closing CDM session %s", m_sessionId.utf8().data());
m_instanceSession->closeSession(m_sessionId, [this, weakThis = makeWeakPtr(*this), promise = WTFMove(promise)] () mutable {
if (!weakThis)
return;
@@ -525,6 +538,8 @@
// 1. If this object is closed, return a promise rejected with an InvalidStateError.
// 2. If this object's callable value is false, return a promise rejected with an InvalidStateError.
+ LOG(EME, "EME - removing session %s", m_sessionId.utf8().data());
+
if (m_closed || !m_callable) {
promise->reject(InvalidStateError);
return;
@@ -660,6 +675,7 @@
{
// https://w3c.github.io/encrypted-media/#session-closed
// W3C Editor's Draft 09 November 2016
+ LOG(EME, "EME - session %s was closed", m_sessionId.utf8().data());
// 1. Let session be the associated MediaKeySession object.
// 2. If session's session type is "persistent-usage-record", execute the following steps in parallel:
Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp (237492 => 237493)
--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp 2018-10-27 14:41:22 UTC (rev 237492)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp 2018-10-27 15:34:35 UTC (rev 237493)
@@ -34,6 +34,7 @@
#include "CDM.h"
#include "CDMClient.h"
#include "CDMInstance.h"
+#include "Logging.h"
#include "MediaKeySession.h"
#include "SharedBuffer.h"
@@ -54,6 +55,7 @@
{
// https://w3c.github.io/encrypted-media/#dom-mediakeys-setservercertificate
// W3C Editor's Draft 09 November 2016
+ LOG(EME, "EME - check if a new session can be created");
// When this method is invoked, the user agent must run the following steps:
// 1. If this object's supported session types value does not contain sessionType, throw [WebIDL] a NotSupportedError.
Modified: trunk/Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp (237492 => 237493)
--- trunk/Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp 2018-10-27 14:41:22 UTC (rev 237492)
+++ trunk/Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp 2018-10-27 15:34:35 UTC (rev 237493)
@@ -34,6 +34,7 @@
#include "CDM.h"
#include "Document.h"
#include "JSMediaKeySystemAccess.h"
+#include "Logging.h"
namespace WebCore {
@@ -43,6 +44,7 @@
{
// https://w3c.github.io/encrypted-media/#dom-navigator-requestmediakeysystemaccess
// W3C Editor's Draft 09 November 2016
+ LOG(EME, "EME - request media key system access for %s", keySystem.utf8().data());
// When this method is invoked, the user agent must run the following steps:
// 1. If keySystem is the empty string, return a promise rejected with a newly created TypeError.
@@ -60,6 +62,7 @@
// 6.1. If keySystem is not one of the Key Systems supported by the user agent, reject promise with a NotSupportedError.
// String comparison is case-sensitive.
if (!CDM::supportsKeySystem(keySystem)) {
+ LOG(EME, "EME - %s is not supported", keySystem.utf8().data());
promise->reject(NotSupportedError);
return;
}