OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 11 matching lines...) Expand all Loading... |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 #include "core/html/track/LoadableTextTrack.h" | 27 #include "core/html/track/LoadableTextTrack.h" |
28 | 28 |
29 #include "core/dom/ElementTraversal.h" | 29 #include "core/dom/ElementTraversal.h" |
30 #include "core/html/HTMLMediaElement.h" | 30 #include "core/html/HTMLMediaElement.h" |
31 #include "core/html/HTMLTrackElement.h" | 31 #include "core/html/HTMLTrackElement.h" |
| 32 #include "core/html/track/CueTimeline.h" |
32 #include "core/html/track/TextTrackCueList.h" | 33 #include "core/html/track/TextTrackCueList.h" |
33 #include "core/html/track/vtt/VTTRegionList.h" | 34 #include "core/html/track/vtt/VTTRegionList.h" |
34 | 35 |
35 namespace blink { | 36 namespace blink { |
36 | 37 |
37 using namespace HTMLNames; | 38 using namespace HTMLNames; |
38 | 39 |
39 LoadableTextTrack::LoadableTextTrack(HTMLTrackElement* track) | 40 LoadableTextTrack::LoadableTextTrack(HTMLTrackElement* track) |
40 : TextTrack(emptyAtom, emptyAtom, emptyAtom, emptyAtom, TrackElement) | 41 : TextTrack(emptyAtom, emptyAtom, emptyAtom, emptyAtom, TrackElement) |
41 , m_trackElement(track) | 42 , m_trackElement(track) |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 m_loader->getNewCues(newCues); | 124 m_loader->getNewCues(newCues); |
124 | 125 |
125 if (!m_cues) | 126 if (!m_cues) |
126 m_cues = TextTrackCueList::create(); | 127 m_cues = TextTrackCueList::create(); |
127 | 128 |
128 for (size_t i = 0; i < newCues.size(); ++i) { | 129 for (size_t i = 0; i < newCues.size(); ++i) { |
129 newCues[i]->setTrack(this); | 130 newCues[i]->setTrack(this); |
130 m_cues->add(newCues[i].release()); | 131 m_cues->add(newCues[i].release()); |
131 } | 132 } |
132 | 133 |
133 if (mediaElement() && mode() != disabledKeyword()) | 134 if (cueTimeline() && mode() != disabledKeyword()) |
134 mediaElement()->textTrackAddCues(this, m_cues.get()); | 135 cueTimeline()->addCues(this, m_cues.get()); |
135 } | 136 } |
136 | 137 |
137 void LoadableTextTrack::cueLoadingCompleted(TextTrackLoader* loader, bool loadin
gFailed) | 138 void LoadableTextTrack::cueLoadingCompleted(TextTrackLoader* loader, bool loadin
gFailed) |
138 { | 139 { |
139 ASSERT_UNUSED(loader, m_loader == loader); | 140 ASSERT_UNUSED(loader, m_loader == loader); |
140 | 141 |
141 #if !ENABLE(OILPAN) | 142 #if !ENABLE(OILPAN) |
142 if (!m_trackElement) | 143 if (!m_trackElement) |
143 return; | 144 return; |
144 #endif | 145 #endif |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 } | 179 } |
179 | 180 |
180 void LoadableTextTrack::trace(Visitor* visitor) | 181 void LoadableTextTrack::trace(Visitor* visitor) |
181 { | 182 { |
182 visitor->trace(m_trackElement); | 183 visitor->trace(m_trackElement); |
183 visitor->trace(m_loader); | 184 visitor->trace(m_loader); |
184 TextTrack::trace(visitor); | 185 TextTrack::trace(visitor); |
185 } | 186 } |
186 | 187 |
187 } // namespace blink | 188 } // namespace blink |
OLD | NEW |