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

Side by Side Diff: third_party/WebKit/Source/core/html/track/TextTrackContainer.cpp

Issue 2556043002: Avoid WTF::Vector::at() and operator[] in core/html. (Closed)
Patch Set: _ Created 4 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google 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 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // Note: Removing all children will cause them to be re-inserted below, 102 // Note: Removing all children will cause them to be re-inserted below,
103 // invalidating the layout. 103 // invalidating the layout.
104 // effect 104 // effect
105 if (reset) 105 if (reset)
106 removeChildren(); 106 removeChildren();
107 107
108 // 10. For each text track cue cue in cues that has not yet had 108 // 10. For each text track cue cue in cues that has not yet had
109 // corresponding CSS boxes added to output, in text track cue order, run the 109 // corresponding CSS boxes added to output, in text track cue order, run the
110 // following substeps: 110 // following substeps:
111 double movieTime = video.currentTime(); 111 double movieTime = video.currentTime();
112 for (size_t i = 0; i < activeCues.size(); ++i) { 112 for (const auto& activeCue : activeCues) {
113 TextTrackCue* cue = activeCues[i].data(); 113 TextTrackCue* cue = activeCue.data();
114 114
115 DCHECK(cue->isActive()); 115 DCHECK(cue->isActive());
116 if (!cue->track() || !cue->track()->isRendered() || !cue->isActive()) 116 if (!cue->track() || !cue->track()->isRendered() || !cue->isActive())
117 continue; 117 continue;
118 118
119 cue->updateDisplay(*this); 119 cue->updateDisplay(*this);
120 cue->updatePastAndFutureNodes(movieTime); 120 cue->updatePastAndFutureNodes(movieTime);
121 } 121 }
122 122
123 // 11. Return output. 123 // 11. Return output.
124 // See the note for step 3 for why there is no output to return. 124 // See the note for step 3 for why there is no output to return.
125 } 125 }
126 126
127 } // namespace blink 127 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698