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

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

Issue 244493002: Oilpan: add transition types to track interface objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Explicitly dispose of TextTrackList + fix handling of {Inband,Loadable}TextTrack Created 6 years, 8 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
Index: Source/core/html/track/TextTrackList.cpp
diff --git a/Source/core/html/track/TextTrackList.cpp b/Source/core/html/track/TextTrackList.cpp
index 348d4abcb79586c940ff92d0e3427342c149845a..87953a375d7e769b0a52c5ff483ba9b2ce108620 100644
--- a/Source/core/html/track/TextTrackList.cpp
+++ b/Source/core/html/track/TextTrackList.cpp
@@ -48,7 +48,10 @@ TextTrackList::~TextTrackList()
ASSERT(!m_owner);
m_asyncEventQueue->close();
+}
+void TextTrackList::dispose()
+{
for (unsigned i = 0; i < length(); ++i) {
item(i)->setTrackList(0);
haraken 2014/04/22 02:37:47 Just help me understand: Why do we need to explici
sof 2014/04/22 06:27:52 Yes, no need to do the clearing for any of those.
haraken 2014/04/22 06:41:09 ah, that makes sense. Thanks for the clarification
}
@@ -153,7 +156,7 @@ TextTrack* TextTrackList::getTrackById(const AtomicString& id)
void TextTrackList::invalidateTrackIndexesAfterTrack(TextTrack* track)
{
- Vector<RefPtr<TextTrack> >* tracks = 0;
+ WillBeHeapVector<RefPtrWillBeMember<TextTrack> >* tracks = 0;
if (track->trackType() == TextTrack::TrackElement) {
tracks = &m_elementTracks;
@@ -178,9 +181,9 @@ void TextTrackList::invalidateTrackIndexesAfterTrack(TextTrack* track)
tracks->at(index)->invalidateTrackIndex();
}
-void TextTrackList::append(PassRefPtr<TextTrack> prpTrack)
+void TextTrackList::append(PassRefPtrWillBeRawPtr<TextTrack> prpTrack)
{
- RefPtr<TextTrack> track = prpTrack;
+ RefPtrWillBeRawPtr<TextTrack> track = prpTrack;
if (track->trackType() == TextTrack::AddTrack)
m_addTrackTracks.append(track);
@@ -205,7 +208,7 @@ void TextTrackList::append(PassRefPtr<TextTrack> prpTrack)
void TextTrackList::remove(TextTrack* track)
{
- Vector<RefPtr<TextTrack> >* tracks = 0;
+ WillBeHeapVector<RefPtrWillBeMember<TextTrack> >* tracks = 0;
if (track->trackType() == TextTrack::TrackElement) {
tracks = &m_elementTracks;
@@ -241,7 +244,7 @@ void TextTrackList::removeAllInbandTracks()
bool TextTrackList::contains(TextTrack* track) const
{
- const Vector<RefPtr<TextTrack> >* tracks = 0;
+ const WillBeHeapVector<RefPtrWillBeMember<TextTrack> >* tracks = 0;
if (track->trackType() == TextTrack::TrackElement)
tracks = &m_elementTracks;
@@ -271,7 +274,7 @@ void TextTrackList::clearOwner()
m_owner = 0;
}
-void TextTrackList::scheduleTrackEvent(const AtomicString& eventName, PassRefPtr<TextTrack> track)
+void TextTrackList::scheduleTrackEvent(const AtomicString& eventName, PassRefPtrWillBeRawPtr<TextTrack> track)
{
TrackEventInit initializer;
initializer.track = track;
@@ -281,7 +284,7 @@ void TextTrackList::scheduleTrackEvent(const AtomicString& eventName, PassRefPtr
m_asyncEventQueue->enqueueEvent(TrackEvent::create(eventName, initializer));
}
-void TextTrackList::scheduleAddTrackEvent(PassRefPtr<TextTrack> track)
+void TextTrackList::scheduleAddTrackEvent(PassRefPtrWillBeRawPtr<TextTrack> track)
{
// 4.8.10.12.3 Sourcing out-of-band text tracks
// 4.8.10.12.4 Text track API
@@ -309,7 +312,7 @@ void TextTrackList::scheduleChangeEvent()
m_asyncEventQueue->enqueueEvent(Event::create(EventTypeNames::change, initializer));
}
-void TextTrackList::scheduleRemoveTrackEvent(PassRefPtr<TextTrack> track)
+void TextTrackList::scheduleRemoveTrackEvent(PassRefPtrWillBeRawPtr<TextTrack> track)
{
// 4.8.10.12.3 Sourcing out-of-band text tracks
// When a track element's parent element changes and the old parent was a
@@ -327,3 +330,10 @@ HTMLMediaElement* TextTrackList::owner() const
{
return m_owner;
}
+
+void TextTrackList::trace(Visitor* visitor)
+{
+ visitor->trace(m_addTrackTracks);
+ visitor->trace(m_elementTracks);
+ visitor->trace(m_inbandTracks);
+}

Powered by Google App Engine
This is Rietveld 408576698