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" |
11 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
12 #include "wtf/Vector.h" | 12 #include "wtf/Vector.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class HTMLMediaElement; | 16 class HTMLMediaElement; |
17 class TextTrackCueList; | 17 class TextTrackCueList; |
18 | 18 |
19 // TODO(Oilpan): This needs to be PODIntervalTree<double, Member<TextTrackCue>>. | 19 // TODO(Oilpan): This needs to be PODIntervalTree<double, Member<TextTrackCue>>. |
20 // However, it is not easy to move PODIntervalTree to the heap (for a C++-templa
te | 20 // However, it is not easy to move PODIntervalTree to the heap (for a |
21 // reason) so we leave it as a raw pointer at the moment. This is safe | 21 // C++-template reason) so we leave it as a raw pointer at the moment. This is |
22 // because CueTimeline and TextTrackCue are guaranteed to die at the same time | 22 // safe because CueTimeline and TextTrackCue are guaranteed to die at the same |
23 // when the owner HTMLMediaElement dies. Thus the raw TextTrackCue* cannot | 23 // time 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 final : public GarbageCollectedFinalized<CueTimeline> { | 31 class CueTimeline final : public GarbageCollectedFinalized<CueTimeline> { |
32 public: | 32 public: |
33 CueTimeline(HTMLMediaElement&); | 33 CueTimeline(HTMLMediaElement&); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 template <> | 92 template <> |
93 struct ValueToString<TextTrackCue*> { | 93 struct ValueToString<TextTrackCue*> { |
94 static String toString(TextTrackCue* const& cue) { return cue->toString(); } | 94 static String toString(TextTrackCue* const& cue) { return cue->toString(); } |
95 }; | 95 }; |
96 #endif | 96 #endif |
97 | 97 |
98 } // namespace blink | 98 } // namespace blink |
99 | 99 |
100 #endif // CueTimeline_h | 100 #endif // CueTimeline_h |
OLD | NEW |