| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 { | 57 { |
| 58 // Negative duration cues need to be treated in the interval tree as | 58 // Negative duration cues need to be treated in the interval tree as |
| 59 // zero-length cues. | 59 // zero-length cues. |
| 60 double endTime = std::max(cue->startTime(), cue->endTime()); | 60 double endTime = std::max(cue->startTime(), cue->endTime()); |
| 61 | 61 |
| 62 CueInterval interval = m_cueTree.createInterval(cue->startTime(), endTime, c
ue.get()); | 62 CueInterval interval = m_cueTree.createInterval(cue->startTime(), endTime, c
ue.get()); |
| 63 m_cueTree.remove(interval); | 63 m_cueTree.remove(interval); |
| 64 | 64 |
| 65 size_t index = m_currentlyActiveCues.find(interval); | 65 size_t index = m_currentlyActiveCues.find(interval); |
| 66 if (index != kNotFound) { | 66 if (index != kNotFound) { |
| 67 ASSERT(cue->isActive()); |
| 67 m_currentlyActiveCues.remove(index); | 68 m_currentlyActiveCues.remove(index); |
| 68 cue->setIsActive(false); | 69 cue->setIsActive(false); |
| 69 // Since the cue will be removed from the media element and likely the | 70 // Since the cue will be removed from the media element and likely the |
| 70 // TextTrack might also be destructed, notifying the region of the cue | 71 // TextTrack might also be destructed, notifying the region of the cue |
| 71 // removal shouldn't be done. | 72 // removal shouldn't be done. |
| 72 cue->removeDisplayTree(TextTrackCue::DontNotifyRegion); | 73 cue->removeDisplayTree(TextTrackCue::DontNotifyRegion); |
| 73 } | 74 } |
| 74 updateActiveCues(mediaElement().currentTime()); | 75 updateActiveCues(mediaElement().currentTime()); |
| 75 } | 76 } |
| 76 | 77 |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 if (!m_ignoreUpdate && mediaElement().inActiveDocument()) | 333 if (!m_ignoreUpdate && mediaElement().inActiveDocument()) |
| 333 updateActiveCues(mediaElement().currentTime()); | 334 updateActiveCues(mediaElement().currentTime()); |
| 334 } | 335 } |
| 335 | 336 |
| 336 DEFINE_TRACE(CueTimeline) | 337 DEFINE_TRACE(CueTimeline) |
| 337 { | 338 { |
| 338 visitor->trace(m_mediaElement); | 339 visitor->trace(m_mediaElement); |
| 339 } | 340 } |
| 340 | 341 |
| 341 } // namespace blink | 342 } // namespace blink |
| OLD | NEW |