| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 // If the cues belong to different text tracks, it doesn't make sense to | 89 // If the cues belong to different text tracks, it doesn't make sense to |
| 90 // compare the two tracks by the relative cue order, so return the relative | 90 // compare the two tracks by the relative cue order, so return the relative |
| 91 // track order. | 91 // track order. |
| 92 if (a.second->track() != b.second->track()) | 92 if (a.second->track() != b.second->track()) |
| 93 return trackIndexCompare(a.second->track(), b.second->track()); | 93 return trackIndexCompare(a.second->track(), b.second->track()); |
| 94 | 94 |
| 95 // 12 - Further sort tasks in events that have the same time by the | 95 // 12 - Further sort tasks in events that have the same time by the |
| 96 // relative text track cue order of the text track cues associated | 96 // relative text track cue order of the text track cues associated |
| 97 // with these tasks. | 97 // with these tasks. |
| 98 return a.second->cueIndex() - b.second->cueIndex() < 0; | 98 return a.second->cueIndex() < b.second->cueIndex(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 static PassRefPtrWillBeRawPtr<Event> createEventWithTarget(const AtomicString& e
ventName, PassRefPtrWillBeRawPtr<EventTarget> eventTarget) | 101 static PassRefPtrWillBeRawPtr<Event> createEventWithTarget(const AtomicString& e
ventName, PassRefPtrWillBeRawPtr<EventTarget> eventTarget) |
| 102 { | 102 { |
| 103 RefPtrWillBeRawPtr<Event> event = Event::create(eventName); | 103 RefPtrWillBeRawPtr<Event> event = Event::create(eventName); |
| 104 event->setTarget(eventTarget); | 104 event->setTarget(eventTarget); |
| 105 return event.release(); | 105 return event.release(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void CueTimeline::updateActiveCues(double movieTime) | 108 void CueTimeline::updateActiveCues(double movieTime) |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 if (!m_ignoreUpdate && mediaElement().inActiveDocument()) | 332 if (!m_ignoreUpdate && mediaElement().inActiveDocument()) |
| 333 updateActiveCues(mediaElement().currentTime()); | 333 updateActiveCues(mediaElement().currentTime()); |
| 334 } | 334 } |
| 335 | 335 |
| 336 DEFINE_TRACE(CueTimeline) | 336 DEFINE_TRACE(CueTimeline) |
| 337 { | 337 { |
| 338 visitor->trace(m_mediaElement); | 338 visitor->trace(m_mediaElement); |
| 339 } | 339 } |
| 340 | 340 |
| 341 } // namespace blink | 341 } // namespace blink |
| OLD | NEW |