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

Side by Side Diff: third_party/WebKit/Source/core/html/MediaFragmentURIParser.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) 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } 143 }
144 144
145 void MediaFragmentURIParser::parseTimeFragment() { 145 void MediaFragmentURIParser::parseTimeFragment() {
146 DCHECK_EQ(m_timeFormat, None); 146 DCHECK_EQ(m_timeFormat, None);
147 147
148 if (m_fragments.isEmpty()) 148 if (m_fragments.isEmpty())
149 parseFragments(); 149 parseFragments();
150 150
151 m_timeFormat = Invalid; 151 m_timeFormat = Invalid;
152 152
153 for (unsigned i = 0; i < m_fragments.size(); ++i) { 153 for (const auto& fragment : m_fragments) {
154 std::pair<String, String>& fragment = m_fragments[i];
155
156 DCHECK(fragment.first.is8Bit()); 154 DCHECK(fragment.first.is8Bit());
157 DCHECK(fragment.second.is8Bit()); 155 DCHECK(fragment.second.is8Bit());
158 156
159 // http://www.w3.org/2008/WebVideo/Fragments/WD-media-fragments-spec/#naming -time 157 // http://www.w3.org/2008/WebVideo/Fragments/WD-media-fragments-spec/#naming -time
160 // Temporal clipping is denoted by the name t, and specified as an interval 158 // Temporal clipping is denoted by the name t, and specified as an interval
161 // with a begin time and an end time 159 // with a begin time and an end time
162 if (fragment.first != "t") 160 if (fragment.first != "t")
163 continue; 161 continue;
164 162
165 // http://www.w3.org/2008/WebVideo/Fragments/WD-media-fragments-spec/#npt-ti me 163 // http://www.w3.org/2008/WebVideo/Fragments/WD-media-fragments-spec/#npt-ti me
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 309
312 if (offset < length && timeString[offset] == '.') 310 if (offset < length && timeString[offset] == '.')
313 fraction = collectFraction(timeString, length, offset).toDouble(); 311 fraction = collectFraction(timeString, length, offset).toDouble();
314 312
315 time = (value1 * secondsPerHour) + (value2 * secondsPerMinute) + value3 + 313 time = (value1 * secondsPerHour) + (value2 * secondsPerMinute) + value3 +
316 fraction; 314 fraction;
317 return true; 315 return true;
318 } 316 }
319 317
320 } // namespace blink 318 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp ('k') | third_party/WebKit/Source/core/html/PublicURLManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698