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

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

Issue 958903002: Move activeCues ownership to TextTrack (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 40052b9b4aef97ea42f7f0571ba537dd3492b12b..646a818fddc3f9e470c458ef5d5b9cf06b2a0959 100644
--- a/Source/core/html/track/TextTrackCueList.cpp
+++ b/Source/core/html/track/TextTrackCueList.cpp
@@ -62,18 +62,13 @@ TextTrackCue* TextTrackCueList::getCueById(const AtomicString& id) const
return nullptr;
}
-TextTrackCueList* TextTrackCueList::activeCues()
+void TextTrackCueList::collectActiveCues(TextTrackCueList& activeCues) const
{
- if (!m_activeCues)
- m_activeCues = create();
-
- m_activeCues->clear();
- for (size_t i = 0; i < m_list.size(); ++i) {
- RefPtrWillBeRawPtr<TextTrackCue> cue = m_list[i];
+ activeCues.clear();
+ for (auto& cue : m_list) {
if (cue->isActive())
- m_activeCues->add(cue);
+ activeCues.add(cue);
}
- return m_activeCues.get();
}
bool TextTrackCueList::add(PassRefPtrWillBeRawPtr<TextTrackCue> cue)
@@ -153,7 +148,6 @@ void TextTrackCueList::invalidateCueIndexes(size_t start)
DEFINE_TRACE(TextTrackCueList)
{
visitor->trace(m_list);
- visitor->trace(m_activeCues);
}
} // namespace blink
« 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