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

Unified Diff: Source/core/html/track/TextTrack.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/TextTrack.h ('k') | Source/core/html/track/TextTrackCueList.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 c8235136bc6abc80dcfec5edb144b3bb7dd3a67f..92f805d4f12004ef149a82eae511593e015f9547 100644
--- a/Source/core/html/track/TextTrack.cpp
+++ b/Source/core/html/track/TextTrack.cpp
@@ -232,7 +232,7 @@ void TextTrack::addListOfCues(WillBeHeapVector<RefPtrWillBeMember<TextTrackCue>>
cueTimeline()->addCues(this, cues);
}
-TextTrackCueList* TextTrack::activeCues() const
+TextTrackCueList* TextTrack::activeCues()
{
// 4.8.10.12.5 If the text track mode ... is not the text track disabled mode,
// then the activeCues attribute must return a live TextTrackCueList object ...
@@ -240,9 +240,14 @@ TextTrackCueList* TextTrack::activeCues() const
// order. Otherwise, it must return null. When an object is returned, the
// same object must be returned each time.
// http://www.whatwg.org/specs/web-apps/current-work/#dom-texttrack-activecues
- if (m_cues && m_mode != disabledKeyword())
- return m_cues->activeCues();
- return nullptr;
+ if (!m_cues || m_mode == disabledKeyword())
+ return nullptr;
+
+ if (!m_activeCues)
+ m_activeCues = TextTrackCueList::create();
+
+ m_cues->collectActiveCues(*m_activeCues);
+ return m_activeCues.get();
}
void TextTrack::addCue(PassRefPtrWillBeRawPtr<TextTrackCue> prpCue)
@@ -467,6 +472,7 @@ Node* TextTrack::owner() const
DEFINE_TRACE(TextTrack)
{
visitor->trace(m_cues);
+ visitor->trace(m_activeCues);
visitor->trace(m_regions);
visitor->trace(m_trackList);
TrackBase::trace(visitor);
« no previous file with comments | « Source/core/html/track/TextTrack.h ('k') | Source/core/html/track/TextTrackCueList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698