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

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

Issue 1013393004: Eliminate TextTrackCue::updateDisplayTree() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: coerce m_isPastNode to bool Created 5 years, 9 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 | « Source/core/dom/StyleChangeReason.cpp ('k') | Source/core/html/track/TextTrackContainer.cpp » ('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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // flag set, none of the cues in other cues have their text track cue active 199 // flag set, none of the cues in other cues have their text track cue active
200 // flag set, and missed cues is empty, then abort these steps. 200 // flag set, and missed cues is empty, then abort these steps.
201 bool activeSetChanged = missedCuesSize; 201 bool activeSetChanged = missedCuesSize;
202 202
203 for (size_t i = 0; !activeSetChanged && i < previousCuesSize; ++i) { 203 for (size_t i = 0; !activeSetChanged && i < previousCuesSize; ++i) {
204 if (!currentCues.contains(previousCues[i]) && previousCues[i].data()->is Active()) 204 if (!currentCues.contains(previousCues[i]) && previousCues[i].data()->is Active())
205 activeSetChanged = true; 205 activeSetChanged = true;
206 } 206 }
207 207
208 for (CueInterval currentCue : currentCues) { 208 for (CueInterval currentCue : currentCues) {
209 currentCue.data()->updateDisplayTree(movieTime); 209 // Notify any cues that are already active of the current time to mark
210 210 // past and future nodes. Any inactive cues have an empty display state;
211 if (!currentCue.data()->isActive()) 211 // they will be notified of the current time when the display state is
212 // updated.
213 if (currentCue.data()->isActive())
214 currentCue.data()->updatePastAndFutureNodes(movieTime);
215 else
212 activeSetChanged = true; 216 activeSetChanged = true;
213 } 217 }
214 218
215 if (!activeSetChanged) 219 if (!activeSetChanged)
216 return; 220 return;
217 221
218 // 7 - If the time was reached through the usual monotonic increase of the 222 // 7 - If the time was reached through the usual monotonic increase of the
219 // current playback position during normal playback, and there are cues in 223 // current playback position during normal playback, and there are cues in
220 // other cues that have their text track cue pause-on-exi flag set and that 224 // other cues that have their text track cue pause-on-exi flag set and that
221 // either have their text track cue active flag set or are also in missed 225 // either have their text track cue active flag set or are also in missed
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 if (!m_ignoreUpdate && mediaElement().inActiveDocument()) 351 if (!m_ignoreUpdate && mediaElement().inActiveDocument())
348 updateActiveCues(mediaElement().currentTime()); 352 updateActiveCues(mediaElement().currentTime());
349 } 353 }
350 354
351 DEFINE_TRACE(CueTimeline) 355 DEFINE_TRACE(CueTimeline)
352 { 356 {
353 visitor->trace(m_mediaElement); 357 visitor->trace(m_mediaElement);
354 } 358 }
355 359
356 } // namespace blink 360 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/StyleChangeReason.cpp ('k') | Source/core/html/track/TextTrackContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698