Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: Source/core/html/track/CueTimeline.cpp

Issue 956323002: Tweak the TextTrackCue "cue index" management (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/html/track/TextTrackCue.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/track/TextTrackCue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698