media: Replace wtf/Assertions.h macros in favor of base/logging.h macros
Replace WTF_LOG macros with DVLOG in AutoplayExperimentHelper.cpp,
HTMLTrackElement.cpp, TextTrackLoader.cpp and VTTRegion.cpp.
BUG=596522
Review-Url: https://codereview.chromium.org/1998553002
Cr-Commit-Position: refs/heads/master@{#394762}
diff --git a/third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp b/third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp
index 56c0aed6..787879f7 100644
--- a/third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp
+++ b/third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp
@@ -39,10 +39,7 @@
{
m_mode = fromString(this->client().autoplayExperimentMode());
- if (isExperimentEnabled()) {
- WTF_LOG(Media, "HTMLMediaElement: autoplay experiment set to %d",
- m_mode);
- }
+ DVLOG_IF(3, isExperimentEnabled()) << "autoplay experiment set to " << m_mode;
}
AutoplayExperimentHelper::~AutoplayExperimentHelper()
diff --git a/third_party/WebKit/Source/core/html/HTMLTrackElement.cpp b/third_party/WebKit/Source/core/html/HTMLTrackElement.cpp
index 7dc0f0cd..b8f3618b 100644
--- a/third_party/WebKit/Source/core/html/HTMLTrackElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLTrackElement.cpp
@@ -34,11 +34,12 @@
#include "core/html/track/LoadableTextTrack.h"
#include "platform/Logging.h"
+#define TRACK_LOG_LEVEL 3
+
namespace blink {
using namespace HTMLNames;
-#if !LOG_DISABLED
static String urlForLoggingTrack(const KURL& url)
{
static const unsigned maximumURLLengthForLogging = 128;
@@ -47,13 +48,12 @@
return url.getString();
return url.getString().substring(0, maximumURLLengthForLogging) + "...";
}
-#endif
inline HTMLTrackElement::HTMLTrackElement(Document& document)
: HTMLElement(trackTag, document)
, m_loadTimer(this, &HTMLTrackElement::loadTimerFired)
{
- WTF_LOG(Media, "HTMLTrackElement::HTMLTrackElement - %p", this);
+ DVLOG(TRACK_LOG_LEVEL) << "HTMLTrackElement - " << (void*)this;
}
DEFINE_NODE_FACTORY(HTMLTrackElement)
@@ -64,7 +64,7 @@
Node::InsertionNotificationRequest HTMLTrackElement::insertedInto(ContainerNode* insertionPoint)
{
- WTF_LOG(Media, "HTMLTrackElement::insertedInto");
+ DVLOG(TRACK_LOG_LEVEL) << "insertedInto";
// Since we've moved to a new parent, we may now be able to load.
scheduleLoad();
@@ -145,7 +145,7 @@
void HTMLTrackElement::scheduleLoad()
{
- WTF_LOG(Media, "HTMLTrackElement::scheduleLoad");
+ DVLOG(TRACK_LOG_LEVEL) << "scheduleLoad";
// 1. If another occurrence of this algorithm is already running for this text track and its track element,
// abort these steps, letting that other algorithm take care of this element.
@@ -170,7 +170,7 @@
void HTMLTrackElement::loadTimerFired(Timer<HTMLTrackElement>*)
{
- WTF_LOG(Media, "HTMLTrackElement::loadTimerFired");
+ DVLOG(TRACK_LOG_LEVEL) << "loadTimerFired";
// 6. [X] Set the text track readiness state to loading.
setReadyState(LOADING);
@@ -231,7 +231,7 @@
return false;
if (!document().contentSecurityPolicy()->allowMediaFromSource(url)) {
- WTF_LOG(Media, "HTMLTrackElement::canLoadUrl(%s) -> rejected by Content Security Policy", urlForLoggingTrack(url).utf8().data());
+ DVLOG(TRACK_LOG_LEVEL) << "canLoadUrl(" << urlForLoggingTrack(url) << ") -> rejected by Content Security Policy";
return false;
}
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.cpp
index 282c5d5c..9bd6ee8 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.cpp
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.cpp
@@ -44,6 +44,8 @@
#include "wtf/MathExtras.h"
#include "wtf/text/StringBuilder.h"
+#define VTT_LOG_LEVEL 3
+
namespace blink {
// The following values default values are defined within the WebVTT Regions Spec.
@@ -254,7 +256,7 @@
if (VTTParser::parseFloatPercentageValue(input, floatWidth) && parsedEntireRun(input, valueRun))
m_width = floatWidth;
else
- WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid Width");
+ DVLOG(VTT_LOG_LEVEL) << "parseSettingValue, invalid Width";
break;
}
case Height: {
@@ -262,7 +264,7 @@
if (input.scanDigits(number) && parsedEntireRun(input, valueRun))
m_heightInLines = number;
else
- WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid Height");
+ DVLOG(VTT_LOG_LEVEL) << "parseSettingValue, invalid Height";
break;
}
case RegionAnchor: {
@@ -270,7 +272,7 @@
if (VTTParser::parseFloatPercentageValuePair(input, ',', anchor) && parsedEntireRun(input, valueRun))
m_regionAnchor = anchor;
else
- WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid RegionAnchor");
+ DVLOG(VTT_LOG_LEVEL) << "parseSettingValue, invalid RegionAnchor";
break;
}
case ViewportAnchor: {
@@ -278,14 +280,14 @@
if (VTTParser::parseFloatPercentageValuePair(input, ',', anchor) && parsedEntireRun(input, valueRun))
m_viewportAnchor = anchor;
else
- WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid ViewportAnchor");
+ DVLOG(VTT_LOG_LEVEL) << "parseSettingValue, invalid ViewportAnchor";
break;
}
case Scroll:
if (input.scanRun(valueRun, scrollUpValueKeyword))
m_scroll = true;
else
- WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid Scroll");
+ DVLOG(VTT_LOG_LEVEL) << "parseSettingValue, invalid Scroll";
break;
case None:
break;
@@ -330,7 +332,7 @@
void VTTRegion::willRemoveVTTCueBox(VTTCueBox* box)
{
- WTF_LOG(Media, "VTTRegion::willRemoveVTTCueBox");
+ DVLOG(VTT_LOG_LEVEL) << "willRemoveVTTCueBox";
ASSERT(m_cueContainer->contains(box));
double boxHeight = box->getBoundingClientRect()->bottom() - box->getBoundingClientRect()->top();
@@ -354,7 +356,7 @@
void VTTRegion::displayLastVTTCueBox()
{
- WTF_LOG(Media, "VTTRegion::displayLastVTTCueBox");
+ DVLOG(VTT_LOG_LEVEL) << "displayLastVTTCueBox";
ASSERT(m_cueContainer);
// FIXME: This should not be causing recalc styles in a loop to set the "top" css
@@ -443,7 +445,7 @@
void VTTRegion::startTimer()
{
- WTF_LOG(Media, "VTTRegion::startTimer");
+ DVLOG(VTT_LOG_LEVEL) << "startTimer";
if (m_scrollTimer.isActive())
return;
@@ -454,7 +456,7 @@
void VTTRegion::stopTimer()
{
- WTF_LOG(Media, "VTTRegion::stopTimer");
+ DVLOG(VTT_LOG_LEVEL) << "stopTimer";
if (m_scrollTimer.isActive())
m_scrollTimer.stop();
@@ -462,7 +464,7 @@
void VTTRegion::scrollTimerFired(Timer<VTTRegion>*)
{
- WTF_LOG(Media, "VTTRegion::scrollTimerFired");
+ DVLOG(VTT_LOG_LEVEL) << "scrollTimerFired";
stopTimer();
displayLastVTTCueBox();
diff --git a/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp b/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp
index db966ba..e8359b6 100644
--- a/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp
@@ -138,8 +138,6 @@
void TextTrackLoader::fileFailedToParse()
{
- WTF_LOG(Media, "TextTrackLoader::fileFailedToParse");
-
m_state = Failed;
if (!m_cueLoadTimer.isActive())