OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/html/track/CueTimeline.h" | 6 #include "core/html/track/CueTimeline.h" |
7 | 7 |
8 #include "core/events/Event.h" | 8 #include "core/events/Event.h" |
9 #include "core/html/HTMLMediaElement.h" | 9 #include "core/html/HTMLMediaElement.h" |
10 #include "core/html/HTMLTrackElement.h" | 10 #include "core/html/HTMLTrackElement.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 ASSERT(cue->isActive()); | 76 ASSERT(cue->isActive()); |
77 m_currentlyActiveCues.remove(index); | 77 m_currentlyActiveCues.remove(index); |
78 cue->setIsActive(false); | 78 cue->setIsActive(false); |
79 // Since the cue will be removed from the media element and likely the | 79 // Since the cue will be removed from the media element and likely the |
80 // TextTrack might also be destructed, notifying the region of the cue | 80 // TextTrack might also be destructed, notifying the region of the cue |
81 // removal shouldn't be done. | 81 // removal shouldn't be done. |
82 cue->removeDisplayTree(TextTrackCue::DontNotifyRegion); | 82 cue->removeDisplayTree(TextTrackCue::DontNotifyRegion); |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
| 86 void CueTimeline::hideCues(TextTrack*, const TextTrackCueList* cues) |
| 87 { |
| 88 for (size_t i = 0; i < cues->length(); ++i) |
| 89 cues->item(i)->removeDisplayTree(); |
| 90 } |
| 91 |
86 static bool trackIndexCompare(TextTrack* a, TextTrack* b) | 92 static bool trackIndexCompare(TextTrack* a, TextTrack* b) |
87 { | 93 { |
88 return a->trackIndex() - b->trackIndex() < 0; | 94 return a->trackIndex() - b->trackIndex() < 0; |
89 } | 95 } |
90 | 96 |
91 static bool eventTimeCueCompare(const std::pair<double, TextTrackCue*>& a, const
std::pair<double, TextTrackCue*>& b) | 97 static bool eventTimeCueCompare(const std::pair<double, TextTrackCue*>& a, const
std::pair<double, TextTrackCue*>& b) |
92 { | 98 { |
93 // 12 - Sort the tasks in events in ascending time order (tasks with earlier | 99 // 12 - Sort the tasks in events in ascending time order (tasks with earlier |
94 // times first). | 100 // times first). |
95 if (a.first != b.first) | 101 if (a.first != b.first) |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 if (!m_ignoreUpdate && mediaElement().inActiveDocument()) | 347 if (!m_ignoreUpdate && mediaElement().inActiveDocument()) |
342 updateActiveCues(mediaElement().currentTime()); | 348 updateActiveCues(mediaElement().currentTime()); |
343 } | 349 } |
344 | 350 |
345 DEFINE_TRACE(CueTimeline) | 351 DEFINE_TRACE(CueTimeline) |
346 { | 352 { |
347 visitor->trace(m_mediaElement); | 353 visitor->trace(m_mediaElement); |
348 } | 354 } |
349 | 355 |
350 } // namespace blink | 356 } // namespace blink |
OLD | NEW |