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

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

Issue 941983003: Hoist cue "deactivation" out of TextTrackCueList::remove (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/TextTrackCueList.h ('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/TextTrackCueList.cpp
diff --git a/Source/core/html/track/TextTrackCueList.cpp b/Source/core/html/track/TextTrackCueList.cpp
index 626182d4ca2a2c8ab7b431171a9feae7ad98cdf1..bb23faffddc60b7993baed665ab706571e53484d 100644
--- a/Source/core/html/track/TextTrackCueList.cpp
+++ b/Source/core/html/track/TextTrackCueList.cpp
@@ -113,24 +113,21 @@ bool TextTrackCueList::remove(TextTrackCue* cue)
if (index == kNotFound)
return false;
- cue->setIsActive(false);
- cue->removeDisplayTree();
-
m_list.remove(index);
return true;
}
-bool TextTrackCueList::contains(TextTrackCue* cue) const
-{
- return m_list.contains(cue);
-}
-
bool TextTrackCueList::updateCueIndex(TextTrackCue* cue)
{
- if (!contains(cue))
+ size_t index = m_list.find(cue);
+ if (index == kNotFound)
return false;
- remove(cue);
+ cue->setIsActive(false);
+ cue->removeDisplayTree();
+
+ m_list.remove(index);
+
return add(cue);
}
« no previous file with comments | « Source/core/html/track/TextTrackCueList.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698