Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(985)

Unified Diff: Source/core/html/track/TextTrackList.cpp

Issue 177243018: Prevent 'removetrack' events from firing when all inband text tracks are removed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix expectations Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..cd429a9d64b70a79d7b6ed7aee1f6a1cef54bf64 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 scheduleEvent)
{
Vector<RefPtr<TextTrack> >* tracks = 0;
RefPtr<InbandTextTrack> inbandTrack;
@@ -228,7 +228,8 @@ void TextTrackList::remove(TextTrack* track)
if (inbandTrack)
inbandTrack->trackRemoved();
- scheduleRemoveTrackEvent(track);
+ if (scheduleEvent)
+ scheduleRemoveTrackEvent(track);
}
bool TextTrackList::contains(TextTrack* track) const
« Source/core/html/HTMLMediaElement.cpp ('K') | « Source/core/html/track/TextTrackList.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698