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 #ifndef CueTimeline_h | 5 #ifndef CueTimeline_h |
6 #define CueTimeline_h | 6 #define CueTimeline_h |
7 | 7 |
8 #include "core/html/track/TextTrackCue.h" | 8 #include "core/html/track/TextTrackCue.h" |
9 #include "core/html/track/vtt/VTTCue.h" | 9 #include "core/html/track/vtt/VTTCue.h" |
10 #include "platform/PODIntervalTree.h" | 10 #include "platform/PODIntervalTree.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // reason) so we leave it as a raw pointer at the moment. This is safe | 21 // reason) so we leave it as a raw pointer at the moment. This is safe |
22 // because CueTimeline and TextTrackCue are guaranteed to die at the same time | 22 // because CueTimeline and TextTrackCue are guaranteed to die at the same time |
23 // when the owner HTMLMediaElement dies. Thus the raw TextTrackCue* cannot | 23 // when the owner HTMLMediaElement dies. Thus the raw TextTrackCue* cannot |
24 // become stale pointers. | 24 // become stale pointers. |
25 typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree; | 25 typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree; |
26 typedef CueIntervalTree::IntervalType CueInterval; | 26 typedef CueIntervalTree::IntervalType CueInterval; |
27 typedef Vector<CueInterval> CueList; | 27 typedef Vector<CueInterval> CueList; |
28 | 28 |
29 // This class manages the timeline and rendering updates of cues associated | 29 // This class manages the timeline and rendering updates of cues associated |
30 // with TextTracks. Owned by a HTMLMediaElement. | 30 // with TextTracks. Owned by a HTMLMediaElement. |
31 class CueTimeline : public NoBaseWillBeGarbageCollectedFinalized<CueTimeline> { | 31 class CueTimeline final : public NoBaseWillBeGarbageCollectedFinalized<CueTimeli
ne> { |
| 32 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(CueTimeline); |
32 public: | 33 public: |
33 CueTimeline(HTMLMediaElement&); | 34 CueTimeline(HTMLMediaElement&); |
34 | 35 |
35 void addCues(TextTrack*, const TextTrackCueList*); | 36 void addCues(TextTrack*, const TextTrackCueList*); |
36 void addCue(TextTrack*, PassRefPtrWillBeRawPtr<TextTrackCue>); | 37 void addCue(TextTrack*, PassRefPtrWillBeRawPtr<TextTrackCue>); |
37 void removeCues(TextTrack*, const TextTrackCueList*); | 38 void removeCues(TextTrack*, const TextTrackCueList*); |
38 void removeCue(TextTrack*, PassRefPtrWillBeRawPtr<TextTrackCue>); | 39 void removeCue(TextTrack*, PassRefPtrWillBeRawPtr<TextTrackCue>); |
39 | 40 |
40 void hideCues(TextTrack*, const TextTrackCueList*); | 41 void hideCues(TextTrack*, const TextTrackCueList*); |
41 | 42 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 static String string(TextTrackCue* const& cue) | 99 static String string(TextTrackCue* const& cue) |
99 { | 100 { |
100 return cue->toString(); | 101 return cue->toString(); |
101 } | 102 } |
102 }; | 103 }; |
103 #endif | 104 #endif |
104 | 105 |
105 } // namespace blink | 106 } // namespace blink |
106 | 107 |
107 #endif // CueTimeline_h | 108 #endif // CueTimeline_h |
OLD | NEW |