Index: Source/core/html/track/TextTrackList.cpp |
diff --git a/Source/core/html/track/TextTrackList.cpp b/Source/core/html/track/TextTrackList.cpp |
index ba8ca1aea8f759f1a53575c5f100be8f5627e0d7..a5b09bde4d6fde5651f054eccef69fd0299caf94 100644 |
--- a/Source/core/html/track/TextTrackList.cpp |
+++ b/Source/core/html/track/TextTrackList.cpp |
@@ -198,7 +198,7 @@ void TextTrackList::append(PassRefPtr<TextTrack> prpTrack) |
scheduleAddTrackEvent(track.release()); |
} |
-void TextTrackList::remove(TextTrack* track) |
+void TextTrackList::remove(TextTrack* track, bool fireRemoveTrackEvent) |
{ |
Vector<RefPtr<TextTrack> >* tracks = 0; |
RefPtr<InbandTextTrack> inbandTrack; |
@@ -228,7 +228,8 @@ void TextTrackList::remove(TextTrack* track) |
if (inbandTrack) |
inbandTrack->trackRemoved(); |
- scheduleRemoveTrackEvent(track); |
+ if (fireRemoveTrackEvent) |
+ scheduleRemoveTrackEvent(track); |
} |
bool TextTrackList::contains(TextTrack* track) const |
@@ -258,6 +259,14 @@ ExecutionContext* TextTrackList::executionContext() const |
return m_owner->executionContext(); |
} |
+void TextTrackList::clearOwnerAndClients() |
+{ |
+ m_owner = 0; |
+ |
+ for (unsigned i = 0; i < length(); ++i) |
+ item(i)->clearClient(); |
+} |
+ |
void TextTrackList::scheduleTrackEvent(const AtomicString& eventName, PassRefPtr<TextTrack> track) |
{ |
TrackEventInit initializer; |