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

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

Issue 1022523002: Clean up around text track display state updates (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | « no previous file | Source/core/html/track/vtt/VTTCue.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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 for (size_t i = 0; i < previousCuesSize; ++i) { 323 for (size_t i = 0; i < previousCuesSize; ++i) {
324 if (!currentCues.contains(previousCues[i])) { 324 if (!currentCues.contains(previousCues[i])) {
325 TextTrackCue* cue = previousCues[i].data(); 325 TextTrackCue* cue = previousCues[i].data();
326 cue->setIsActive(false); 326 cue->setIsActive(false);
327 cue->removeDisplayTree(); 327 cue->removeDisplayTree();
328 } 328 }
329 } 329 }
330 330
331 // Update the current active cues. 331 // Update the current active cues.
332 m_currentlyActiveCues = currentCues; 332 m_currentlyActiveCues = currentCues;
333 333 mediaElement.updateTextTrackDisplay();
334 if (activeSetChanged)
335 mediaElement.updateTextTrackDisplay();
336 } 334 }
337 335
338 void CueTimeline::beginIgnoringUpdateRequests() 336 void CueTimeline::beginIgnoringUpdateRequests()
339 { 337 {
340 ++m_ignoreUpdate; 338 ++m_ignoreUpdate;
341 } 339 }
342 340
343 void CueTimeline::endIgnoringUpdateRequests() 341 void CueTimeline::endIgnoringUpdateRequests()
344 { 342 {
345 ASSERT(m_ignoreUpdate); 343 ASSERT(m_ignoreUpdate);
346 --m_ignoreUpdate; 344 --m_ignoreUpdate;
347 if (!m_ignoreUpdate && mediaElement().inActiveDocument()) 345 if (!m_ignoreUpdate && mediaElement().inActiveDocument())
348 updateActiveCues(mediaElement().currentTime()); 346 updateActiveCues(mediaElement().currentTime());
349 } 347 }
350 348
351 DEFINE_TRACE(CueTimeline) 349 DEFINE_TRACE(CueTimeline)
352 { 350 {
353 visitor->trace(m_mediaElement); 351 visitor->trace(m_mediaElement);
354 } 352 }
355 353
356 } // namespace blink 354 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/track/vtt/VTTCue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698