| Index: third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
|
| index 04ff65ad2d8217d90dd1960c860c800112cc9fb1..0cc8359b5321ff5f8ada481d0a22167f0848fa70 100644
|
| --- a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
|
| +++ b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
|
| @@ -123,7 +123,7 @@
|
|
|
| static bool isInvalidPercentage(double value)
|
| {
|
| - DCHECK(std::isfinite(value));
|
| + ASSERT(std::isfinite(value));
|
| return value < 0 || value > 100;
|
| }
|
|
|
| @@ -272,7 +272,7 @@
|
| case VerticalGrowingRight:
|
| return verticalGrowingRightKeyword();
|
| default:
|
| - NOTREACHED();
|
| + ASSERT_NOT_REACHED();
|
| return emptyString();
|
| }
|
| }
|
| @@ -287,7 +287,7 @@
|
| else if (value == verticalGrowingRightKeyword())
|
| direction = VerticalGrowingRight;
|
| else
|
| - NOTREACHED();
|
| + ASSERT_NOT_REACHED();
|
|
|
| if (direction == m_writingDirection)
|
| return;
|
| @@ -332,7 +332,7 @@
|
| return;
|
| floatPosition = std::numeric_limits<float>::quiet_NaN();
|
| } else {
|
| - DCHECK(position.isDouble());
|
| + ASSERT(position.isDouble());
|
| floatPosition = narrowPrecisionToFloat(position.getAsDouble());
|
| if (m_linePosition == floatPosition)
|
| return;
|
| @@ -369,7 +369,7 @@
|
| return;
|
| floatPosition = std::numeric_limits<float>::quiet_NaN();
|
| } else {
|
| - DCHECK(position.isDouble());
|
| + ASSERT(position.isDouble());
|
| if (isInvalidPercentage(position.getAsDouble(), exceptionState))
|
| return;
|
| floatPosition = narrowPrecisionToFloat(position.getAsDouble());
|
| @@ -414,7 +414,7 @@
|
| case Right:
|
| return rightKeyword();
|
| default:
|
| - NOTREACHED();
|
| + ASSERT_NOT_REACHED();
|
| return emptyString();
|
| }
|
| }
|
| @@ -433,7 +433,7 @@
|
| else if (value == rightKeyword())
|
| alignment = Right;
|
| else
|
| - NOTREACHED();
|
| + ASSERT_NOT_REACHED();
|
|
|
| if (alignment == m_cueAlignment)
|
| return;
|
| @@ -565,7 +565,7 @@
|
|
|
| static CSSValueID determineTextDirection(DocumentFragment* vttRoot)
|
| {
|
| - DCHECK(vttRoot);
|
| + ASSERT(vttRoot);
|
|
|
| // Apply the Unicode Bidirectional Algorithm's Paragraph Level steps to the
|
| // concatenation of the values of each WebVTT Text Object in nodes, in a
|
| @@ -574,7 +574,7 @@
|
| TextDirection textDirection = LTR;
|
| Node* node = NodeTraversal::next(*vttRoot);
|
| while (node) {
|
| - DCHECK(node->isDescendantOf(vttRoot));
|
| + ASSERT(node->isDescendantOf(vttRoot));
|
|
|
| if (node->isTextNode()) {
|
| bool hasStrongDirectionality;
|
| @@ -615,7 +615,7 @@
|
| case Middle:
|
| return 50;
|
| default:
|
| - NOTREACHED();
|
| + ASSERT_NOT_REACHED();
|
| return 0;
|
| }
|
| }
|
| @@ -676,7 +676,7 @@
|
| maximumSize = computedTextPosition <= 50 ? computedTextPosition : (100 - computedTextPosition);
|
| maximumSize = maximumSize * 2;
|
| } else {
|
| - NOTREACHED();
|
| + ASSERT_NOT_REACHED();
|
| }
|
|
|
| // 5. If the cue size is less than maximum size, then let size
|
| @@ -703,7 +703,7 @@
|
| displayParameters.position.setX(computedTextPosition - displayParameters.size / 2);
|
| break;
|
| default:
|
| - NOTREACHED();
|
| + ASSERT_NOT_REACHED();
|
| }
|
| } else {
|
| // Cases for m_writingDirection being VerticalGrowing{Left|Right}
|
| @@ -718,7 +718,7 @@
|
| displayParameters.position.setY(computedTextPosition - displayParameters.size / 2);
|
| break;
|
| default:
|
| - NOTREACHED();
|
| + ASSERT_NOT_REACHED();
|
| }
|
| }
|
|
|
| @@ -748,9 +748,9 @@
|
| ? computedLinePosition
|
| : std::numeric_limits<float>::quiet_NaN();
|
|
|
| - DCHECK(std::isfinite(displayParameters.size));
|
| - DCHECK_NE(displayParameters.direction, CSSValueNone);
|
| - DCHECK_NE(displayParameters.writingMode, CSSValueNone);
|
| + ASSERT(std::isfinite(displayParameters.size));
|
| + ASSERT(displayParameters.direction != CSSValueNone);
|
| + ASSERT(displayParameters.writingMode != CSSValueNone);
|
| return displayParameters;
|
| }
|
|
|
| @@ -758,7 +758,7 @@
|
| {
|
| DEFINE_STATIC_LOCAL(const String, timestampTag, ("timestamp"));
|
|
|
| - DCHECK(isActive());
|
| + ASSERT(isActive());
|
|
|
| // An active cue may still not have a display tree, e.g. if its track is
|
| // hidden or if the track belongs to an audio element.
|
| @@ -780,7 +780,8 @@
|
| for (Node& child : NodeTraversal::descendantsOf(*m_displayTree)) {
|
| if (child.nodeName() == timestampTag) {
|
| double currentTimestamp;
|
| - DCHECK(VTTParser::collectTimeStamp(child.nodeValue(), currentTimestamp));
|
| + bool check = VTTParser::collectTimeStamp(child.nodeValue(), currentTimestamp);
|
| + ASSERT_UNUSED(check, check);
|
|
|
| if (currentTimestamp > movieTime)
|
| isPastNode = false;
|
| @@ -797,14 +798,14 @@
|
|
|
| VTTCueBox* VTTCue::getDisplayTree()
|
| {
|
| - DCHECK(track() && track()->isRendered() && isActive());
|
| + ASSERT(track() && track()->isRendered() && isActive());
|
|
|
| if (!m_displayTree) {
|
| m_displayTree = VTTCueBox::create(document());
|
| m_displayTree->appendChild(m_cueBackgroundBox);
|
| }
|
|
|
| - DCHECK_EQ(m_displayTree->firstChild(), m_cueBackgroundBox);
|
| + ASSERT(m_displayTree->firstChild() == m_cueBackgroundBox);
|
|
|
| if (!m_displayTreeShouldChange) {
|
| // Apply updated user style overrides for text tracks when display tree doesn't change.
|
| @@ -852,7 +853,7 @@
|
|
|
| void VTTCue::updateDisplay(HTMLDivElement& container)
|
| {
|
| - DCHECK(track() && track()->isRendered() && isActive());
|
| + ASSERT(track() && track()->isRendered() && isActive());
|
|
|
| UseCounter::count(document(), UseCounter::VTTCueRender);
|
|
|
| @@ -1128,13 +1129,13 @@
|
|
|
| ExecutionContext* VTTCue::getExecutionContext() const
|
| {
|
| - DCHECK(m_cueBackgroundBox);
|
| + ASSERT(m_cueBackgroundBox);
|
| return m_cueBackgroundBox->getExecutionContext();
|
| }
|
|
|
| Document& VTTCue::document() const
|
| {
|
| - DCHECK(m_cueBackgroundBox);
|
| + ASSERT(m_cueBackgroundBox);
|
| return m_cueBackgroundBox->document();
|
| }
|
|
|
|
|