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

Unified Diff: Source/core/html/HTMLMediaElement.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 | « no previous file | Source/core/html/track/LoadableTextTrack.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 30d735635cdc8873fc886b9209930e87e269d4d6..f65713b0a8f2ef6749daefd727309aff2c50577b 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -1483,8 +1483,7 @@ void HTMLMediaElement::endIgnoringTrackDisplayUpdateRequests()
void HTMLMediaElement::textTrackAddCues(TextTrack* track, const TextTrackCueList* cues)
{
WTF_LOG(Media, "HTMLMediaElement::textTrackAddCues(%p)", this);
- if (track->mode() == TextTrack::disabledKeyword())
- return;
+ ASSERT(track->mode() != TextTrack::disabledKeyword());
TrackDisplayUpdateScope scope(this);
for (size_t i = 0; i < cues->length(); ++i)
@@ -1502,8 +1501,7 @@ void HTMLMediaElement::textTrackRemoveCues(TextTrack*, const TextTrackCueList* c
void HTMLMediaElement::textTrackAddCue(TextTrack* track, PassRefPtrWillBeRawPtr<TextTrackCue> cue)
{
- if (track->mode() == TextTrack::disabledKeyword())
- return;
+ ASSERT(track->mode() != TextTrack::disabledKeyword());
// Negative duration cues need be treated in the interval tree as
// zero-length cues.
« no previous file with comments | « no previous file | Source/core/html/track/LoadableTextTrack.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698