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

Side by Side Diff: third_party/WebKit/Source/build/scripts/make_css_property_names.py

Issue 2668903003: Replace WTF::emptyString{16Bit}() with a static global (Closed)
Patch Set: Replace WTF::emptyString{16Bit}() with a static global Created 3 years, 10 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 import subprocess 3 import subprocess
4 import sys 4 import sys
5 5
6 import css_properties 6 import css_properties
7 import json5_generator 7 import json5_generator
8 import license 8 import license
9 9
10 10
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // We share the StringImpl with the AtomicStrings. 149 // We share the StringImpl with the AtomicStrings.
150 return getPropertyNameAtomicString(id).getString(); 150 return getPropertyNameAtomicString(id).getString();
151 } 151 }
152 152
153 String getJSPropertyName(CSSPropertyID id) 153 String getJSPropertyName(CSSPropertyID id)
154 { 154 {
155 char result[maxCSSPropertyNameLength + 1]; 155 char result[maxCSSPropertyNameLength + 1];
156 const char* cssPropertyName = getPropertyName(id); 156 const char* cssPropertyName = getPropertyName(id);
157 const char* propertyNamePointer = cssPropertyName; 157 const char* propertyNamePointer = cssPropertyName;
158 if (!propertyNamePointer) 158 if (!propertyNamePointer)
159 return emptyString(); 159 return emptyString;
160 160
161 char* resultPointer = result; 161 char* resultPointer = result;
162 while (char character = *propertyNamePointer++) { 162 while (char character = *propertyNamePointer++) {
163 if (character == '-') { 163 if (character == '-') {
164 char nextCharacter = *propertyNamePointer++; 164 char nextCharacter = *propertyNamePointer++;
165 if (!nextCharacter) 165 if (!nextCharacter)
166 break; 166 break;
167 character = (propertyNamePointer - 2 != cssPropertyName) ? toASCIIUp per(nextCharacter) : nextCharacter; 167 character = (propertyNamePointer - 2 != cssPropertyName) ? toASCIIUp per(nextCharacter) : nextCharacter;
168 } 168 }
169 *resultPointer++ = character; 169 *resultPointer++ = character;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 # CalledProcessError like subprocess would do when shell=True is set. 237 # CalledProcessError like subprocess would do when shell=True is set.
238 try: 238 try:
239 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=s ubprocess.PIPE, universal_newlines=True) 239 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=s ubprocess.PIPE, universal_newlines=True)
240 return gperf.communicate(gperf_input)[0] 240 return gperf.communicate(gperf_input)[0]
241 except OSError: 241 except OSError:
242 raise subprocess.CalledProcessError(127, gperf_args, output='Command not found.') 242 raise subprocess.CalledProcessError(127, gperf_args, output='Command not found.')
243 243
244 244
245 if __name__ == "__main__": 245 if __name__ == "__main__":
246 json5_generator.Maker(CSSPropertyNamesWriter).main() 246 json5_generator.Maker(CSSPropertyNamesWriter).main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698