OLD | NEW |
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 in_generator | 7 import in_generator |
8 import license | 8 import license |
9 | 9 |
10 | 10 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 if (propertyString.isNull()) { | 142 if (propertyString.isNull()) { |
143 const char* propertyName = propertyNameStringsPool + propertyNameStrings
Offsets[index]; | 143 const char* propertyName = propertyNameStringsPool + propertyNameStrings
Offsets[index]; |
144 propertyString = AtomicString(propertyName, strlen(propertyName), Atomic
String::ConstructFromLiteral); | 144 propertyString = AtomicString(propertyName, strlen(propertyName), Atomic
String::ConstructFromLiteral); |
145 } | 145 } |
146 return propertyString; | 146 return propertyString; |
147 } | 147 } |
148 | 148 |
149 String getPropertyNameString(CSSPropertyID id) | 149 String getPropertyNameString(CSSPropertyID id) |
150 { | 150 { |
151 // We share the StringImpl with the AtomicStrings. | 151 // We share the StringImpl with the AtomicStrings. |
152 return getPropertyNameAtomicString(id).string(); | 152 return getPropertyNameAtomicString(id).getString(); |
153 } | 153 } |
154 | 154 |
155 String getJSPropertyName(CSSPropertyID id) | 155 String getJSPropertyName(CSSPropertyID id) |
156 { | 156 { |
157 char result[maxCSSPropertyNameLength + 1]; | 157 char result[maxCSSPropertyNameLength + 1]; |
158 const char* cssPropertyName = getPropertyName(id); | 158 const char* cssPropertyName = getPropertyName(id); |
159 const char* propertyNamePointer = cssPropertyName; | 159 const char* propertyNamePointer = cssPropertyName; |
160 if (!propertyNamePointer) | 160 if (!propertyNamePointer) |
161 return emptyString(); | 161 return emptyString(); |
162 | 162 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 # FIXME: If we could depend on Python 2.7, we would use subprocess.check
_output | 231 # FIXME: If we could depend on Python 2.7, we would use subprocess.check
_output |
232 gperf_args = [self.gperf_path, '--key-positions=*', '-P', '-n'] | 232 gperf_args = [self.gperf_path, '--key-positions=*', '-P', '-n'] |
233 gperf_args.extend(['-m', '50']) # Pick best of 50 attempts. | 233 gperf_args.extend(['-m', '50']) # Pick best of 50 attempts. |
234 gperf_args.append('-D') # Allow duplicate hashes -> More compact code. | 234 gperf_args.append('-D') # Allow duplicate hashes -> More compact code. |
235 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subpr
ocess.PIPE, universal_newlines=True) | 235 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subpr
ocess.PIPE, universal_newlines=True) |
236 return gperf.communicate(gperf_input)[0] | 236 return gperf.communicate(gperf_input)[0] |
237 | 237 |
238 | 238 |
239 if __name__ == "__main__": | 239 if __name__ == "__main__": |
240 in_generator.Maker(CSSPropertyNamesWriter).main(sys.argv) | 240 in_generator.Maker(CSSPropertyNamesWriter).main(sys.argv) |
OLD | NEW |