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

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

Issue 910843002: Hoist checks for 'disabled' tracks out of textTrackAddCue{,s} (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Missed a spot. Created 5 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
« no previous file with comments | « Source/core/html/track/LoadableTextTrack.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/TextTrack.cpp
diff --git a/Source/core/html/track/TextTrack.cpp b/Source/core/html/track/TextTrack.cpp
index 6b3941845c9482fde2e97b674bd062f5735bcfeb..f46fc5d053c75590de97635cef01e14e120296a2 100644
--- a/Source/core/html/track/TextTrack.cpp
+++ b/Source/core/html/track/TextTrack.cpp
@@ -247,7 +247,7 @@ void TextTrack::addCue(PassRefPtrWillBeRawPtr<TextTrackCue> prpCue)
cue->setTrack(this);
ensureTextTrackCueList()->add(cue);
- if (mediaElement())
+ if (mediaElement() && m_mode != disabledKeyword())
mediaElement()->textTrackAddCue(this, cue.get());
}
@@ -367,7 +367,10 @@ void TextTrack::cueDidChange(TextTrackCue* cue)
// Make sure the TextTrackCueList order is up-to-date.
ensureTextTrackCueList()->updateCueIndex(cue);
- // ... and add it back again.
+ // ... and add it back again if the track is enabled.
+ if (m_mode == disabledKeyword())
+ return;
+
mediaElement()->textTrackAddCue(this, cue);
}
« no previous file with comments | « Source/core/html/track/LoadableTextTrack.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698