Index: third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp |
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp |
index 809753e5b54adcf985ad7b0f85f1187e6725e40d..24ffe78c197189bd76419af259e7851f459157d3 100644 |
--- a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp |
+++ b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp |
@@ -21,6 +21,8 @@ |
#include "platform/Logging.h" |
#include "wtf/Functional.h" |
jrummell
2016/05/23 22:53:56
#include base/logging.h
Srirama
2016/05/24 16:24:03
Not able to include base/logging.h because of depe
jrummell
2016/05/24 18:07:11
Acknowledged. This is indeed strange, but looking
|
+#define EME_LOG_LEVEL 3 |
+ |
namespace blink { |
// This class allows MediaKeys to be set asynchronously. |
@@ -73,13 +75,13 @@ public: |
void completeWithContentDecryptionModule(WebContentDecryptionModule*) override |
{ |
- ASSERT_NOT_REACHED(); |
+ NOTREACHED(); |
(*m_failureCallback)(InvalidStateError, "Unexpected completion."); |
} |
void completeWithSession(WebContentDecryptionModuleResult::SessionStatus status) override |
{ |
- ASSERT_NOT_REACHED(); |
+ NOTREACHED(); |
(*m_failureCallback)(InvalidStateError, "Unexpected completion."); |
} |
@@ -116,7 +118,7 @@ SetMediaKeysHandler::SetMediaKeysHandler(ScriptState* scriptState, HTMLMediaElem |
, m_madeReservation(false) |
, m_timer(this, &SetMediaKeysHandler::timerFired) |
{ |
- WTF_LOG(Media, "SetMediaKeysHandler::SetMediaKeysHandler"); |
+ DVLOG(EME_LOG_LEVEL) << "SetMediaKeysHandler"; |
jrummell
2016/05/23 22:53:56
We should probably use __FUNCTION__ instead of the
Srirama
2016/05/24 16:24:03
Done.
|
// 5. Run the following steps in parallel. |
m_timer.startOneShot(0, BLINK_FROM_HERE); |
@@ -133,7 +135,7 @@ void SetMediaKeysHandler::timerFired(Timer<SetMediaKeysHandler>*) |
void SetMediaKeysHandler::clearExistingMediaKeys() |
{ |
- WTF_LOG(Media, "SetMediaKeysHandler::clearExistingMediaKeys"); |
+ DVLOG(EME_LOG_LEVEL) << "clearExistingMediaKeys"; |
HTMLMediaElementEncryptedMedia& thisElement = HTMLMediaElementEncryptedMedia::from(*m_element); |
// 5.1 If mediaKeys is not null, the CDM instance represented by |
@@ -182,7 +184,7 @@ void SetMediaKeysHandler::clearExistingMediaKeys() |
void SetMediaKeysHandler::setNewMediaKeys() |
{ |
- WTF_LOG(Media, "SetMediaKeysHandler::setNewMediaKeys"); |
+ DVLOG(EME_LOG_LEVEL) << "setNewMediaKeys"; |
// 5.3 If mediaKeys is not null, run the following steps: |
if (m_newMediaKeys) { |
@@ -210,7 +212,7 @@ void SetMediaKeysHandler::setNewMediaKeys() |
void SetMediaKeysHandler::finish() |
{ |
- WTF_LOG(Media, "SetMediaKeysHandler::finish"); |
+ DVLOG(EME_LOG_LEVEL) << "finish"; |
HTMLMediaElementEncryptedMedia& thisElement = HTMLMediaElementEncryptedMedia::from(*m_element); |
// 5.4 Set the mediaKeys attribute to mediaKeys. |
@@ -242,7 +244,7 @@ void SetMediaKeysHandler::fail(ExceptionCode code, const String& errorMessage) |
void SetMediaKeysHandler::clearFailed(ExceptionCode code, const String& errorMessage) |
{ |
- WTF_LOG(Media, "SetMediaKeysHandler::clearFailed (%d, %s)", code, errorMessage.ascii().data()); |
+ DVLOG(EME_LOG_LEVEL) << "clearFailed (" << code << ", " << errorMessage << ")"; |
HTMLMediaElementEncryptedMedia& thisElement = HTMLMediaElementEncryptedMedia::from(*m_element); |
// 5.2.4 If the preceding step failed, let this object's attaching media |
@@ -254,7 +256,7 @@ void SetMediaKeysHandler::clearFailed(ExceptionCode code, const String& errorMes |
void SetMediaKeysHandler::setFailed(ExceptionCode code, const String& errorMessage) |
{ |
- WTF_LOG(Media, "SetMediaKeysHandler::setFailed (%d, %s)", code, errorMessage.ascii().data()); |
+ DVLOG(EME_LOG_LEVEL) << "setFailed (" << code << ", " << errorMessage << ")"; |
HTMLMediaElementEncryptedMedia& thisElement = HTMLMediaElementEncryptedMedia::from(*m_element); |
// 5.3.2 If the preceding step failed (in setContentDecryptionModule() |
@@ -286,7 +288,7 @@ HTMLMediaElementEncryptedMedia::HTMLMediaElementEncryptedMedia(HTMLMediaElement& |
HTMLMediaElementEncryptedMedia::~HTMLMediaElementEncryptedMedia() |
{ |
- WTF_LOG(Media, "HTMLMediaElementEncryptedMedia::~HTMLMediaElementEncryptedMedia"); |
+ DVLOG(EME_LOG_LEVEL) << "~HTMLMediaElementEncryptedMedia"; |
} |
const char* HTMLMediaElementEncryptedMedia::supplementName() |
@@ -313,7 +315,7 @@ MediaKeys* HTMLMediaElementEncryptedMedia::mediaKeys(HTMLMediaElement& element) |
ScriptPromise HTMLMediaElementEncryptedMedia::setMediaKeys(ScriptState* scriptState, HTMLMediaElement& element, MediaKeys* mediaKeys) |
{ |
HTMLMediaElementEncryptedMedia& thisElement = HTMLMediaElementEncryptedMedia::from(element); |
- WTF_LOG(Media, "HTMLMediaElementEncryptedMedia::setMediaKeys current(%p), new(%p)", thisElement.m_mediaKeys.get(), mediaKeys); |
+ DVLOG(EME_LOG_LEVEL) << "setMediaKeys current(" << thisElement.m_mediaKeys.get() << "), new(" << mediaKeys << ")"; |
jrummell
2016/05/23 22:53:56
std::hex and std::dec?
Srirama
2016/05/24 16:24:03
Why std::hex and std::dec? I guess, you want "this
jrummell
2016/05/24 18:07:11
Acknowledged. I just looked for other uses of "<<
|
// From http://w3c.github.io/encrypted-media/#setMediaKeys |
@@ -350,7 +352,7 @@ static Event* createEncryptedEvent(WebEncryptedMediaInitDataType initDataType, c |
void HTMLMediaElementEncryptedMedia::encrypted(WebEncryptedMediaInitDataType initDataType, const unsigned char* initData, unsigned initDataLength) |
{ |
- WTF_LOG(Media, "HTMLMediaElementEncryptedMedia::encrypted"); |
+ DVLOG(EME_LOG_LEVEL) << "encrypted"; |
Event* event; |
if (m_mediaElement->isMediaDataCORSSameOrigin(m_mediaElement->getExecutionContext()->getSecurityOrigin())) { |
@@ -367,7 +369,7 @@ void HTMLMediaElementEncryptedMedia::encrypted(WebEncryptedMediaInitDataType ini |
void HTMLMediaElementEncryptedMedia::didBlockPlaybackWaitingForKey() |
{ |
- WTF_LOG(Media, "HTMLMediaElementEncryptedMedia::didBlockPlaybackWaitingForKey"); |
+ DVLOG(EME_LOG_LEVEL) << "didBlockPlaybackWaitingForKey"; |
// From https://w3c.github.io/encrypted-media/#queue-waitingforkey: |
// It should only be called when the HTMLMediaElement object is potentially |
@@ -392,7 +394,7 @@ void HTMLMediaElementEncryptedMedia::didBlockPlaybackWaitingForKey() |
void HTMLMediaElementEncryptedMedia::didResumePlaybackBlockedForKey() |
{ |
- WTF_LOG(Media, "HTMLMediaElementEncryptedMedia::didResumePlaybackBlockedForKey"); |
+ DVLOG(EME_LOG_LEVEL) << "didResumePlaybackBlockedForKey"; |
// Logic is on the Chromium side to attempt to resume playback when a new |
// key is available. However, |m_isWaitingForKey| needs to be cleared so |