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

Unified Diff: third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp

Issue 2001173002: encryptedmedia: Replace wtf/Assertions.h macros in favor of base/logging.h macros (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 7 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: 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..aefb7f2e040379cd9edb3c459337047f552427fc 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) << __FUNCTION__ << "(" << this << ")";
}
MediaKeys::~MediaKeys()
{
- WTF_LOG(Media, "MediaKeys(%p)::~MediaKeys", this);
+ DVLOG(MEDIA_KEYS_LOG_LEVEL) << __FUNCTION__ << "(" << 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) << __FUNCTION__ << "(" << 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) << __FUNCTION__ << "(" << 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) << __FUNCTION__ << "(" << this << ")"
+ << (!m_pendingActions.isEmpty() ? " !m_pendingActions.isEmpty()" : "")
+ << (m_reservedForMediaElement ? " m_reservedForMediaElement" : "");
return !m_pendingActions.isEmpty() || m_reservedForMediaElement;
}

Powered by Google App Engine
This is Rietveld 408576698