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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |