Commit 5ded67d7 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Add some temporary CHECKs to verify theories about infinite loops/hangs

Bug: 1021630
Change-Id: I50f835362b404f7c5e8828d70581078b7145f322
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1937067
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719544}
parent ee9a41f4
......@@ -454,6 +454,9 @@ void SMILTimeContainer::UpdateIntervals(SMILTime document_time) {
DCHECK_GE(document_time, SMILTime());
DCHECK(!priority_queue_.IsEmpty());
const size_t kMaxIterations = std::max(priority_queue_.size() * 16, 1000000u);
size_t current_iteration = 0;
base::AutoReset<bool> updating_intervals_scope(&is_updating_intervals_, true);
while (priority_queue_.Min() <= document_time) {
SVGSMILElement* element = priority_queue_.MinElement();
......@@ -462,6 +465,8 @@ void SMILTimeContainer::UpdateIntervals(SMILTime document_time) {
SMILTime next_interval_time =
element->ComputeNextIntervalTime(document_time);
priority_queue_.Update(next_interval_time, element);
// Debugging signal for crbug.com/1021630.
CHECK_LT(current_iteration++, kMaxIterations);
}
}
......
......@@ -772,6 +772,8 @@ SMILInterval SVGSMILElement::ResolveInterval(SMILTime begin_after,
SMILTime end_after) const {
// Simplified version of the pseudocode in
// http://www.w3.org/TR/SMIL3/smil-timing.html#q90.
const size_t kMaxIterations = std::max(begin_times_.size() * 4, 1000000u);
size_t current_iteration = 0;
while (true) {
SMILTime temp_begin = FindInstanceTime(kBegin, begin_after, true);
if (temp_begin.IsUnresolved())
......@@ -788,6 +790,8 @@ SMILInterval SVGSMILElement::ResolveInterval(SMILTime begin_after,
if (begin_after == temp_end)
temp_end = begin_after + SMILTime::Epsilon();
begin_after = temp_end;
// Debugging signal for crbug.com/1021630.
CHECK_LT(current_iteration++, kMaxIterations);
}
return SMILInterval::Unresolved();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment