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

Unified Diff: Source/core/html/track/CueTimeline.cpp

Issue 993563002: Remove internal uses of TrackDisplayUpdateScope in CueTimeline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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
« no previous file with comments | « Source/core/html/track/CueTimeline.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/CueTimeline.cpp
diff --git a/Source/core/html/track/CueTimeline.cpp b/Source/core/html/track/CueTimeline.cpp
index 0a35f354c3131e2d80e711c9d0eb1a645eae79e0..141e1f3b9d5dcef5f218f1a92b54a74588494f6c 100644
--- a/Source/core/html/track/CueTimeline.cpp
+++ b/Source/core/html/track/CueTimeline.cpp
@@ -26,16 +26,20 @@ CueTimeline::CueTimeline(HTMLMediaElement& mediaElement)
void CueTimeline::addCues(TextTrack* track, const TextTrackCueList* cues)
{
ASSERT(track->mode() != TextTrack::disabledKeyword());
-
- TrackDisplayUpdateScope scope(*this);
for (size_t i = 0; i < cues->length(); ++i)
- addCue(cues->item(i)->track(), cues->item(i));
+ addCueInternal(cues->item(i));
+ updateActiveCues(mediaElement().currentTime());
}
void CueTimeline::addCue(TextTrack* track, PassRefPtrWillBeRawPtr<TextTrackCue> cue)
{
ASSERT(track->mode() != TextTrack::disabledKeyword());
+ addCueInternal(cue);
+ updateActiveCues(mediaElement().currentTime());
+}
+void CueTimeline::addCueInternal(PassRefPtrWillBeRawPtr<TextTrackCue> cue)
+{
// Negative duration cues need be treated in the interval tree as
// zero-length cues.
double endTime = std::max(cue->startTime(), cue->endTime());
@@ -43,18 +47,23 @@ void CueTimeline::addCue(TextTrack* track, PassRefPtrWillBeRawPtr<TextTrackCue>
CueInterval interval = m_cueTree.createInterval(cue->startTime(), endTime, cue.get());
if (!m_cueTree.contains(interval))
m_cueTree.add(interval);
- updateActiveCues(mediaElement().currentTime());
}
void CueTimeline::removeCues(TextTrack*, const TextTrackCueList* cues)
{
- TrackDisplayUpdateScope scope(*this);
for (size_t i = 0; i < cues->length(); ++i)
- removeCue(cues->item(i)->track(), cues->item(i));
+ removeCueInternal(cues->item(i));
+ updateActiveCues(mediaElement().currentTime());
}
void CueTimeline::removeCue(TextTrack*, PassRefPtrWillBeRawPtr<TextTrackCue> cue)
{
+ removeCueInternal(cue);
+ updateActiveCues(mediaElement().currentTime());
+}
+
+void CueTimeline::removeCueInternal(PassRefPtrWillBeRawPtr<TextTrackCue> cue)
+{
// Negative duration cues need to be treated in the interval tree as
// zero-length cues.
double endTime = std::max(cue->startTime(), cue->endTime());
@@ -72,7 +81,6 @@ void CueTimeline::removeCue(TextTrack*, PassRefPtrWillBeRawPtr<TextTrackCue> cue
// removal shouldn't be done.
cue->removeDisplayTree(TextTrackCue::DontNotifyRegion);
}
- updateActiveCues(mediaElement().currentTime());
}
static bool trackIndexCompare(TextTrack* a, TextTrack* b)
« no previous file with comments | « Source/core/html/track/CueTimeline.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698