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

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

Issue 74623002: Remove the logic for de-duplicating in-band text track cues (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: WebVTTParser.cpp was moved Created 7 years, 1 month 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/TextTrack.h ('k') | Source/core/html/track/TextTrackCue.h » ('j') | 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 b050e9deaa5b1c63f46f8979b22dd08f4dd6fee7..a0968f46039f247614ef0ece4a1b00e3f336fcf4 100644
--- a/Source/core/html/track/TextTrack.cpp
+++ b/Source/core/html/track/TextTrack.cpp
@@ -417,64 +417,6 @@ int TextTrack::trackIndexRelativeToRenderedTracks()
return m_renderedTrackIndex;
}
-bool TextTrack::hasCue(TextTrackCue* cue)
-{
- if (cue->startTime() < 0 || cue->endTime() < 0)
- return false;
-
- if (!m_cues || !m_cues->length())
- return false;
-
- size_t searchStart = 0;
- size_t searchEnd = m_cues->length();
-
- while (1) {
- ASSERT(searchStart <= m_cues->length());
- ASSERT(searchEnd <= m_cues->length());
-
- TextTrackCue* existingCue;
-
- // Cues in the TextTrackCueList are maintained in start time order.
- if (searchStart == searchEnd) {
- if (!searchStart)
- return false;
-
- // If there is more than one cue with the same start time, back up to first one so we
- // consider all of them.
- while (searchStart >= 2 && cue->startTime() == m_cues->item(searchStart - 2)->startTime())
- --searchStart;
-
- bool firstCompare = true;
- while (1) {
- if (!firstCompare)
- ++searchStart;
- firstCompare = false;
- if (searchStart > m_cues->length())
- return false;
-
- existingCue = m_cues->item(searchStart - 1);
- if (!existingCue || cue->startTime() > existingCue->startTime())
- return false;
-
- if (*existingCue != *cue)
- continue;
-
- return true;
- }
- }
-
- size_t index = (searchStart + searchEnd) / 2;
- existingCue = m_cues->item(index);
- if (cue->startTime() < existingCue->startTime() || (cue->startTime() == existingCue->startTime() && cue->endTime() > existingCue->endTime()))
- searchEnd = index;
- else
- searchStart = index + 1;
- }
-
- ASSERT_NOT_REACHED();
- return false;
-}
-
const AtomicString& TextTrack::interfaceName() const
{
return EventTargetNames::TextTrack;
« no previous file with comments | « Source/core/html/track/TextTrack.h ('k') | Source/core/html/track/TextTrackCue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698