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

Side by Side Diff: Source/core/html/track/TextTrackList.cpp

Issue 606703002: Comply (more) with check-webkit-style in and around HTMLMediaElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 if (track->trackType() == TextTrack::TrackElement) { 162 if (track->trackType() == TextTrack::TrackElement) {
163 tracks = &m_elementTracks; 163 tracks = &m_elementTracks;
164 for (size_t i = 0; i < m_addTrackTracks.size(); ++i) 164 for (size_t i = 0; i < m_addTrackTracks.size(); ++i)
165 m_addTrackTracks[i]->invalidateTrackIndex(); 165 m_addTrackTracks[i]->invalidateTrackIndex();
166 for (size_t i = 0; i < m_inbandTracks.size(); ++i) 166 for (size_t i = 0; i < m_inbandTracks.size(); ++i)
167 m_inbandTracks[i]->invalidateTrackIndex(); 167 m_inbandTracks[i]->invalidateTrackIndex();
168 } else if (track->trackType() == TextTrack::AddTrack) { 168 } else if (track->trackType() == TextTrack::AddTrack) {
169 tracks = &m_addTrackTracks; 169 tracks = &m_addTrackTracks;
170 for (size_t i = 0; i < m_inbandTracks.size(); ++i) 170 for (size_t i = 0; i < m_inbandTracks.size(); ++i)
171 m_inbandTracks[i]->invalidateTrackIndex(); 171 m_inbandTracks[i]->invalidateTrackIndex();
172 } else if (track->trackType() == TextTrack::InBand) 172 } else if (track->trackType() == TextTrack::InBand) {
173 tracks = &m_inbandTracks; 173 tracks = &m_inbandTracks;
174 else 174 } else {
175 ASSERT_NOT_REACHED(); 175 ASSERT_NOT_REACHED();
176 }
176 177
177 size_t index = tracks->find(track); 178 size_t index = tracks->find(track);
178 if (index == kNotFound) 179 if (index == kNotFound)
179 return; 180 return;
180 181
181 for (size_t i = index; i < tracks->size(); ++i) 182 for (size_t i = index; i < tracks->size(); ++i)
182 tracks->at(index)->invalidateTrackIndex(); 183 tracks->at(index)->invalidateTrackIndex();
183 } 184 }
184 185
185 void TextTrackList::append(PassRefPtrWillBeRawPtr<TextTrack> prpTrack) 186 void TextTrackList::append(PassRefPtrWillBeRawPtr<TextTrack> prpTrack)
186 { 187 {
187 RefPtrWillBeRawPtr<TextTrack> track = prpTrack; 188 RefPtrWillBeRawPtr<TextTrack> track = prpTrack;
188 189
189 if (track->trackType() == TextTrack::AddTrack) 190 if (track->trackType() == TextTrack::AddTrack) {
190 m_addTrackTracks.append(track); 191 m_addTrackTracks.append(track);
191 else if (track->trackType() == TextTrack::TrackElement) { 192 } else if (track->trackType() == TextTrack::TrackElement) {
192 // Insert tracks added for <track> element in tree order. 193 // Insert tracks added for <track> element in tree order.
193 size_t index = static_cast<LoadableTextTrack*>(track.get())->trackElemen tIndex(); 194 size_t index = static_cast<LoadableTextTrack*>(track.get())->trackElemen tIndex();
194 m_elementTracks.insert(index, track); 195 m_elementTracks.insert(index, track);
195 } else if (track->trackType() == TextTrack::InBand) { 196 } else if (track->trackType() == TextTrack::InBand) {
196 // Insert tracks added for in-band in the media file order. 197 // Insert tracks added for in-band in the media file order.
197 size_t index = static_cast<InbandTextTrack*>(track.get())->inbandTrackIn dex(); 198 size_t index = static_cast<InbandTextTrack*>(track.get())->inbandTrackIn dex();
198 m_inbandTracks.insert(index, track); 199 m_inbandTracks.insert(index, track);
199 } else 200 } else {
200 ASSERT_NOT_REACHED(); 201 ASSERT_NOT_REACHED();
202 }
201 203
202 invalidateTrackIndexesAfterTrack(track.get()); 204 invalidateTrackIndexesAfterTrack(track.get());
203 205
204 ASSERT(!track->trackList()); 206 ASSERT(!track->trackList());
205 track->setTrackList(this); 207 track->setTrackList(this);
206 208
207 scheduleAddTrackEvent(track.release()); 209 scheduleAddTrackEvent(track.release());
208 } 210 }
209 211
210 void TextTrackList::remove(TextTrack* track) 212 void TextTrackList::remove(TextTrack* track)
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 333
332 void TextTrackList::trace(Visitor* visitor) 334 void TextTrackList::trace(Visitor* visitor)
333 { 335 {
334 visitor->trace(m_owner); 336 visitor->trace(m_owner);
335 visitor->trace(m_asyncEventQueue); 337 visitor->trace(m_asyncEventQueue);
336 visitor->trace(m_addTrackTracks); 338 visitor->trace(m_addTrackTracks);
337 visitor->trace(m_elementTracks); 339 visitor->trace(m_elementTracks);
338 visitor->trace(m_inbandTracks); 340 visitor->trace(m_inbandTracks);
339 EventTargetWithInlineData::trace(visitor); 341 EventTargetWithInlineData::trace(visitor);
340 } 342 }
OLDNEW
« no previous file with comments | « Source/core/html/shadow/MediaControlElements.cpp ('k') | Source/core/html/track/vtt/VTTElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698