| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef TrackListBase_h | 5 #ifndef TrackListBase_h |
| 6 #define TrackListBase_h | 6 #define TrackListBase_h |
| 7 | 7 |
| 8 #include "core/events/EventTarget.h" | 8 #include "core/events/EventTarget.h" |
| 9 | 9 |
| 10 #include "core/html/HTMLMediaElement.h" | 10 #include "core/html/HTMLMediaElement.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 { | 66 { |
| 67 for (unsigned i = 0; i < m_tracks.size(); ++i) { | 67 for (unsigned i = 0; i < m_tracks.size(); ++i) { |
| 68 if (m_tracks[i]->trackId() != trackId) | 68 if (m_tracks[i]->trackId() != trackId) |
| 69 continue; | 69 continue; |
| 70 | 70 |
| 71 m_tracks[i]->setMediaElement(0); | 71 m_tracks[i]->setMediaElement(0); |
| 72 scheduleTrackEvent(EventTypeNames::removetrack, m_tracks[i]); | 72 scheduleTrackEvent(EventTypeNames::removetrack, m_tracks[i]); |
| 73 m_tracks.remove(i); | 73 m_tracks.remove(i); |
| 74 return; | 74 return; |
| 75 } | 75 } |
| 76 ASSERT_NOT_REACHED(); | 76 NOTREACHED(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void removeAll() | 79 void removeAll() |
| 80 { | 80 { |
| 81 for (unsigned i = 0; i < m_tracks.size(); ++i) | 81 for (unsigned i = 0; i < m_tracks.size(); ++i) |
| 82 m_tracks[i]->setMediaElement(0); | 82 m_tracks[i]->setMediaElement(0); |
| 83 | 83 |
| 84 m_tracks.clear(); | 84 m_tracks.clear(); |
| 85 } | 85 } |
| 86 | 86 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 115 m_mediaElement->scheduleEvent(event); | 115 m_mediaElement->scheduleEvent(event); |
| 116 } | 116 } |
| 117 | 117 |
| 118 HeapVector<Member<T>> m_tracks; | 118 HeapVector<Member<T>> m_tracks; |
| 119 Member<HTMLMediaElement> m_mediaElement; | 119 Member<HTMLMediaElement> m_mediaElement; |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 } // namespace blink | 122 } // namespace blink |
| 123 | 123 |
| 124 #endif | 124 #endif |
| OLD | NEW |