Index: Source/core/html/track/TextTrackList.cpp |
diff --git a/Source/core/html/track/TextTrackList.cpp b/Source/core/html/track/TextTrackList.cpp |
index 588e3768c9aa5368e9406d72f08b47160df738bf..375b14a2858b70bcc09df2e5f84854934b86a229 100644 |
--- a/Source/core/html/track/TextTrackList.cpp |
+++ b/Source/core/html/track/TextTrackList.cpp |
@@ -201,7 +201,6 @@ void TextTrackList::append(PassRefPtr<TextTrack> prpTrack) |
void TextTrackList::remove(TextTrack* track) |
{ |
Vector<RefPtr<TextTrack> >* tracks = 0; |
- RefPtr<InbandTextTrack> inbandTrack; |
if (track->trackType() == TextTrack::TrackElement) { |
tracks = &m_elementTracks; |
@@ -209,7 +208,6 @@ void TextTrackList::remove(TextTrack* track) |
tracks = &m_addTrackTracks; |
} else if (track->trackType() == TextTrack::InBand) { |
tracks = &m_inbandTracks; |
- inbandTrack = static_cast<InbandTextTrack*>(track); |
} else { |
ASSERT_NOT_REACHED(); |
} |
@@ -225,12 +223,18 @@ void TextTrackList::remove(TextTrack* track) |
tracks->remove(index); |
- if (inbandTrack) |
- inbandTrack->trackRemoved(); |
- |
scheduleRemoveTrackEvent(track); |
} |
+void TextTrackList::removeAllInbandTracks() |
+{ |
+ for (unsigned i = 0; i < m_inbandTracks.size(); ++i) { |
+ m_inbandTracks[i]->invalidateTrackIndex(); |
+ m_inbandTracks[i]->setTrackList(0); |
+ } |
+ m_inbandTracks.clear(); |
+} |
+ |
bool TextTrackList::contains(TextTrack* track) const |
{ |
const Vector<RefPtr<TextTrack> >* tracks = 0; |
@@ -318,7 +322,7 @@ void TextTrackList::scheduleRemoveTrackEvent(PassRefPtr<TextTrack> track) |
scheduleTrackEvent(EventTypeNames::removetrack, track); |
} |
-Node* TextTrackList::owner() const |
+HTMLMediaElement* TextTrackList::owner() const |
{ |
return m_owner; |
} |