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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 class TrackDisplayUpdateScope { | 68 class TrackDisplayUpdateScope { |
69 STACK_ALLOCATED(); | 69 STACK_ALLOCATED(); |
70 public: | 70 public: |
71 TrackDisplayUpdateScope(CueTimeline& cueTimeline) | 71 TrackDisplayUpdateScope(CueTimeline& cueTimeline) |
72 { | 72 { |
73 m_cueTimeline = &cueTimeline; | 73 m_cueTimeline = &cueTimeline; |
74 m_cueTimeline->beginIgnoringUpdateRequests(); | 74 m_cueTimeline->beginIgnoringUpdateRequests(); |
75 } | 75 } |
76 ~TrackDisplayUpdateScope() | 76 ~TrackDisplayUpdateScope() |
77 { | 77 { |
78 ASSERT(m_cueTimeline); | 78 DCHECK(m_cueTimeline); |
79 m_cueTimeline->endIgnoringUpdateRequests(); | 79 m_cueTimeline->endIgnoringUpdateRequests(); |
80 } | 80 } |
81 | 81 |
82 private: | 82 private: |
83 Member<CueTimeline> m_cueTimeline; | 83 Member<CueTimeline> m_cueTimeline; |
84 }; | 84 }; |
85 | 85 |
86 #ifndef NDEBUG | 86 #ifndef NDEBUG |
87 // Template specializations required by PodIntervalTree in debug mode. | 87 // Template specializations required by PodIntervalTree in debug mode. |
88 template <> | 88 template <> |
89 struct ValueToString<double> { | 89 struct ValueToString<double> { |
90 static String toString(const double value) | 90 static String toString(const double value) |
91 { | 91 { |
92 return String::number(value); | 92 return String::number(value); |
93 } | 93 } |
94 }; | 94 }; |
95 | 95 |
96 template <> | 96 template <> |
97 struct ValueToString<TextTrackCue*> { | 97 struct ValueToString<TextTrackCue*> { |
98 static String toString(TextTrackCue* const& cue) | 98 static String toString(TextTrackCue* const& cue) |
99 { | 99 { |
100 return cue->toString(); | 100 return cue->toString(); |
101 } | 101 } |
102 }; | 102 }; |
103 #endif | 103 #endif |
104 | 104 |
105 } // namespace blink | 105 } // namespace blink |
106 | 106 |
107 #endif // CueTimeline_h | 107 #endif // CueTimeline_h |
OLD | NEW |