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

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

Issue 939193002: Remove TextTrackCue::notifyRegionWhenRemovingDisplayTree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Hoist removeDisplayTree-call from setIsActive. Created 5 years, 10 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 | « no previous file | Source/core/html/track/TextTrackCue.h » ('j') | 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 dd9b60e7975ed7d0fe37e9b8c28b12142a927baa..af6dcd83881001efa4e42f8d290b1495d2cd7c04 100644
--- a/Source/core/html/track/CueTimeline.cpp
+++ b/Source/core/html/track/CueTimeline.cpp
@@ -62,20 +62,16 @@ void CueTimeline::removeCue(TextTrack*, PassRefPtrWillBeRawPtr<TextTrackCue> cue
CueInterval interval = m_cueTree.createInterval(cue->startTime(), endTime, cue.get());
m_cueTree.remove(interval);
- // Since the cue will be removed from the media element and likely the
- // TextTrack might also be destructed, notifying the region of the cue
- // removal shouldn't be done.
- cue->notifyRegionWhenRemovingDisplayTree(false);
-
size_t index = m_currentlyActiveCues.find(interval);
if (index != kNotFound) {
m_currentlyActiveCues.remove(index);
cue->setIsActive(false);
+ // Since the cue will be removed from the media element and likely the
+ // TextTrack might also be destructed, notifying the region of the cue
+ // removal shouldn't be done.
+ cue->removeDisplayTree(TextTrackCue::DontNotifyRegion);
}
- cue->removeDisplayTree();
updateActiveCues(mediaElement().currentTime());
-
- cue->notifyRegionWhenRemovingDisplayTree(true);
}
static bool trackIndexCompare(TextTrack* a, TextTrack* b)
@@ -319,8 +315,11 @@ void CueTimeline::updateActiveCues(double movieTime)
currentCues[i].data()->setIsActive(true);
for (size_t i = 0; i < previousCuesSize; ++i) {
- if (!currentCues.contains(previousCues[i]))
- previousCues[i].data()->setIsActive(false);
+ if (!currentCues.contains(previousCues[i])) {
+ TextTrackCue* cue = previousCues[i].data();
+ cue->setIsActive(false);
+ cue->removeDisplayTree();
+ }
}
// Update the current active cues.
« no previous file with comments | « no previous file | Source/core/html/track/TextTrackCue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698