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

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

Issue 994353003: Hide call to removeDisplayTree in CueTimeline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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
« no previous file with comments | « Source/core/html/track/CueTimeline.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 void TextTrack::setMode(const AtomicString& mode) 167 void TextTrack::setMode(const AtomicString& mode)
168 { 168 {
169 ASSERT(mode == disabledKeyword() || mode == hiddenKeyword() || mode == showi ngKeyword()); 169 ASSERT(mode == disabledKeyword() || mode == hiddenKeyword() || mode == showi ngKeyword());
170 170
171 // On setting, if the new value isn't equal to what the attribute would curr ently 171 // On setting, if the new value isn't equal to what the attribute would curr ently
172 // return, the new value must be processed as follows ... 172 // return, the new value must be processed as follows ...
173 if (m_mode == mode) 173 if (m_mode == mode)
174 return; 174 return;
175 175
176 // If mode changes to disabled, remove this track's cues from the client 176 if (m_cues && cueTimeline()) {
177 // because they will no longer be accessible from the cues() function. 177 // If mode changes to disabled, remove this track's cues from the client
178 if (mode == disabledKeyword() && cueTimeline() && m_cues) 178 // because they will no longer be accessible from the cues() function.
179 cueTimeline()->removeCues(this, m_cues.get()); 179 if (mode == disabledKeyword())
180 180 cueTimeline()->removeCues(this, m_cues.get());
181 if (mode != showingKeyword() && m_cues) 181 else if (mode != showingKeyword())
182 for (size_t i = 0; i < m_cues->length(); ++i) 182 cueTimeline()->hideCues(this, m_cues.get());
183 m_cues->item(i)->removeDisplayTree(); 183 }
184 184
185 m_mode = mode; 185 m_mode = mode;
186 186
187 if (mode != disabledKeyword() && readinessState() == Loaded) { 187 if (mode != disabledKeyword() && readinessState() == Loaded) {
188 if (m_cues && cueTimeline()) 188 if (m_cues && cueTimeline())
189 cueTimeline()->addCues(this, m_cues.get()); 189 cueTimeline()->addCues(this, m_cues.get());
190 } 190 }
191 191
192 if (mediaElement()) 192 if (mediaElement())
193 mediaElement()->textTrackModeChanged(this); 193 mediaElement()->textTrackModeChanged(this);
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 { 488 {
489 visitor->trace(m_cues); 489 visitor->trace(m_cues);
490 visitor->trace(m_activeCues); 490 visitor->trace(m_activeCues);
491 visitor->trace(m_regions); 491 visitor->trace(m_regions);
492 visitor->trace(m_trackList); 492 visitor->trace(m_trackList);
493 TrackBase::trace(visitor); 493 TrackBase::trace(visitor);
494 EventTargetWithInlineData::trace(visitor); 494 EventTargetWithInlineData::trace(visitor);
495 } 495 }
496 496
497 } // namespace blink 497 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/track/CueTimeline.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698