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

Side by Side Diff: Source/core/html/MediaFragmentURIParser.cpp

Issue 124003003: Add ascii() / latin1() / utf8() methods to AtomicString to avoid having to call string() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | Source/core/html/track/vtt/VTTCue.cpp » ('j') | 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, 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // from the list. 127 // from the list.
128 String name = decodeURLEscapeSequences(fragmentString.substring(paramete rStart, equalOffset - parameterStart)); 128 String name = decodeURLEscapeSequences(fragmentString.substring(paramete rStart, equalOffset - parameterStart));
129 String value; 129 String value;
130 if (equalOffset != parameterEnd) 130 if (equalOffset != parameterEnd)
131 value = decodeURLEscapeSequences(fragmentString.substring(equalOffse t + 1, parameterEnd - equalOffset - 1)); 131 value = decodeURLEscapeSequences(fragmentString.substring(equalOffse t + 1, parameterEnd - equalOffset - 1));
132 132
133 // b. Convert name and value to Unicode strings by interpreting them as UTF-8. If either 133 // b. Convert name and value to Unicode strings by interpreting them as UTF-8. If either
134 // name or value are not valid UTF-8 strings, then remove the name-v alue pair from the list. 134 // name or value are not valid UTF-8 strings, then remove the name-v alue pair from the list.
135 bool validUTF8 = true; 135 bool validUTF8 = true;
136 if (!name.isEmpty()) { 136 if (!name.isEmpty()) {
137 name = name.utf8(String::StrictConversion).data(); 137 name = name.utf8(StrictUTF8Conversion).data();
138 validUTF8 = !name.isEmpty(); 138 validUTF8 = !name.isEmpty();
139 } 139 }
140 if (validUTF8 && !value.isEmpty()) { 140 if (validUTF8 && !value.isEmpty()) {
141 value = value.utf8(String::StrictConversion).data(); 141 value = value.utf8(StrictUTF8Conversion).data();
142 validUTF8 = !value.isEmpty(); 142 validUTF8 = !value.isEmpty();
143 } 143 }
144 144
145 if (validUTF8) 145 if (validUTF8)
146 m_fragments.append(std::make_pair(name, value)); 146 m_fragments.append(std::make_pair(name, value));
147 147
148 offset = parameterEnd + 1; 148 offset = parameterEnd + 1;
149 } 149 }
150 } 150 }
151 151
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 } 310 }
311 311
312 if (offset < length && timeString[offset] == '.') 312 if (offset < length && timeString[offset] == '.')
313 fraction = collectFraction(timeString, length, offset).toDouble(); 313 fraction = collectFraction(timeString, length, offset).toDouble();
314 314
315 time = (value1 * secondsPerHour) + (value2 * secondsPerMinute) + value3 + fr action; 315 time = (value1 * secondsPerHour) + (value2 * secondsPerMinute) + value3 + fr action;
316 return true; 316 return true;
317 } 317 }
318 318
319 } 319 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | Source/core/html/track/vtt/VTTCue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698