| Index: third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp
|
| diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp
|
| index 66afd1f2cf93984b0cbb45e392a32909a0d4182b..b9abe56777816d28a75c4ef29f2697c5a4fe41a3 100644
|
| --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp
|
| +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp
|
| @@ -39,6 +39,8 @@
|
| #include "public/platform/WebContentDecryptionModule.h"
|
| #include "wtf/RefPtr.h"
|
|
|
| +#define MEDIA_KEYS_LOG_LEVEL 3
|
| +
|
| namespace blink {
|
|
|
| // A class holding a pending action.
|
| @@ -56,8 +58,8 @@ public:
|
|
|
| static PendingAction* CreatePendingSetServerCertificate(ContentDecryptionModuleResult* result, DOMArrayBuffer* serverCertificate)
|
| {
|
| - ASSERT(result);
|
| - ASSERT(serverCertificate);
|
| + DCHECK(result);
|
| + DCHECK(serverCertificate);
|
| return new PendingAction(result, serverCertificate);
|
| }
|
|
|
| @@ -94,17 +96,17 @@ MediaKeys::MediaKeys(ExecutionContext* context, const WebVector<WebEncryptedMedi
|
| , m_reservedForMediaElement(false)
|
| , m_timer(this, &MediaKeys::timerFired)
|
| {
|
| - WTF_LOG(Media, "MediaKeys(%p)::MediaKeys", this);
|
| + DVLOG(MEDIA_KEYS_LOG_LEVEL) << "MediaKeys(" << this << ")";
|
| }
|
|
|
| MediaKeys::~MediaKeys()
|
| {
|
| - WTF_LOG(Media, "MediaKeys(%p)::~MediaKeys", this);
|
| + DVLOG(MEDIA_KEYS_LOG_LEVEL) << "~MediaKeys(" << this << ")";
|
| }
|
|
|
| MediaKeySession* MediaKeys::createSession(ScriptState* scriptState, const String& sessionTypeString, ExceptionState& exceptionState)
|
| {
|
| - WTF_LOG(Media, "MediaKeys(%p)::createSession %s", this, sessionTypeString.utf8().data());
|
| + DVLOG(MEDIA_KEYS_LOG_LEVEL) << "createSession(" << this << ") " << sessionTypeString;
|
|
|
| // From http://w3c.github.io/encrypted-media/#createSession
|
|
|
| @@ -189,7 +191,7 @@ void MediaKeys::cancelReservation()
|
|
|
| void MediaKeys::clearMediaElement()
|
| {
|
| - ASSERT(m_mediaElement);
|
| + DCHECK(m_mediaElement);
|
| m_mediaElement.clear();
|
| }
|
|
|
| @@ -205,7 +207,7 @@ bool MediaKeys::sessionTypeSupported(WebEncryptedMediaSessionType sessionType)
|
|
|
| void MediaKeys::timerFired(Timer<MediaKeys>*)
|
| {
|
| - ASSERT(m_pendingActions.size());
|
| + DCHECK(m_pendingActions.size());
|
|
|
| // Swap the queue to a local copy to avoid problems if resolving promises
|
| // run synchronously.
|
| @@ -214,7 +216,7 @@ void MediaKeys::timerFired(Timer<MediaKeys>*)
|
|
|
| while (!pendingActions.isEmpty()) {
|
| PendingAction* action = pendingActions.takeFirst();
|
| - WTF_LOG(Media, "MediaKeys(%p)::timerFired: Certificate", this);
|
| + DVLOG(MEDIA_KEYS_LOG_LEVEL) << "timerFired(" << this << ") Certificate";
|
|
|
| // 5.1 Let cdm be the cdm during the initialization of this object.
|
| WebContentDecryptionModule* cdm = contentDecryptionModule();
|
| @@ -252,9 +254,9 @@ void MediaKeys::contextDestroyed()
|
| bool MediaKeys::hasPendingActivity() const
|
| {
|
| // Remain around if there are pending events.
|
| - WTF_LOG(Media, "MediaKeys(%p)::hasPendingActivity %s%s", this,
|
| - !m_pendingActions.isEmpty() ? " !m_pendingActions.isEmpty()" : "",
|
| - m_reservedForMediaElement ? " m_reservedForMediaElement" : "");
|
| + DVLOG(MEDIA_KEYS_LOG_LEVEL) << "hasPendingActivity(" << this << ") "
|
| + << (!m_pendingActions.isEmpty() ? " !m_pendingActions.isEmpty()" : "")
|
| + << (m_reservedForMediaElement ? " m_reservedForMediaElement" : "");
|
|
|
| return !m_pendingActions.isEmpty() || m_reservedForMediaElement;
|
| }
|
|
|