Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 """This is the entry point to create Dart APIs from the IDL database.""" | 6 """This is the entry point to create Dart APIs from the IDL database.""" |
| 7 | 7 |
| 8 import dartgenerator | 8 import dartgenerator |
| 9 import database | 9 import database |
| 10 import fremontcutbuilder | 10 import fremontcutbuilder |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 HTML_LIBRARY_NAMES, template_loader, 'dartium', dartium_output_dir) | 131 HTML_LIBRARY_NAMES, template_loader, 'dartium', dartium_output_dir) |
| 132 | 132 |
| 133 RunGenerator(dart_libraries, dart_output_dir, | 133 RunGenerator(dart_libraries, dart_output_dir, |
| 134 template_loader, backend_factory) | 134 template_loader, backend_factory) |
| 135 cpp_library_emitter.EmitDerivedSources( | 135 cpp_library_emitter.EmitDerivedSources( |
| 136 template_loader.Load('cpp_derived_sources.template'), | 136 template_loader.Load('cpp_derived_sources.template'), |
| 137 dartium_output_dir) | 137 dartium_output_dir) |
| 138 cpp_library_emitter.EmitResolver( | 138 cpp_library_emitter.EmitResolver( |
| 139 template_loader.Load('cpp_resolver.template'), dartium_output_dir) | 139 template_loader.Load('cpp_resolver.template'), dartium_output_dir) |
| 140 | 140 |
| 141 path = os.path.join(cpp_output_dir, 'DartClassIds.h') | |
|
siva
2013/09/12 18:18:20
Can we call this file DartWebkitClassIds.h instead
| |
| 142 e = emitters.FileEmitter(path) | |
| 143 e.Emit(""" | |
| 144 // WARNING: Do not edit - generated code. | |
| 145 | |
| 146 #ifndef DartClassIds_h | |
| 147 #define DartClassIds_h | |
|
siva
2013/09/12 18:18:20
DartWebkitClassIds_h
| |
| 148 | |
| 149 namespace WebCore { | |
| 150 | |
| 151 enum { | |
| 152 _HistoryCrossFrameClassId = 0, | |
| 153 _LocationCrossFrameClassId, | |
| 154 _DOMWindowCrossFrameClassId, | |
| 155 _NPObjectClassId, | |
|
siva
2013/09/12 18:18:20
We should add a comment here that whenever new typ
| |
| 156 """) | |
| 157 for interface in webkit_database.GetInterfaces(): | |
| 158 interface_name = interface.id | |
| 159 e.Emit(' %sClassId,\n' % interface_name) | |
| 160 e.Emit(""" | |
| 161 NumClassIds | |
|
siva
2013/09/12 18:18:20
kNumWebKitClassIds maybe for this maybe.
| |
| 162 }; | |
| 163 | |
| 164 } // namespace WebCore | |
| 165 | |
| 166 #endif // DartClassIds_h | |
|
siva
2013/09/12 18:18:20
Ditto comment
| |
| 167 """) | |
| 168 | |
| 141 _logger.info('Flush...') | 169 _logger.info('Flush...') |
| 142 emitters.Flush() | 170 emitters.Flush() |
| 143 | 171 |
| 144 if update_dom_metadata: | 172 if update_dom_metadata: |
| 145 metadata.Flush() | 173 metadata.Flush() |
| 146 | 174 |
| 147 monitored.FinishMonitoring(dart2js_output_dir) | 175 monitored.FinishMonitoring(dart2js_output_dir) |
| 148 | 176 |
| 149 def GenerateSingleFile(library_path, output_dir, generated_output_dir=None): | 177 def GenerateSingleFile(library_path, output_dir, generated_output_dir=None): |
| 150 library_dir = os.path.dirname(library_path) | 178 library_dir = os.path.dirname(library_path) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 216 os.path.join('..', '..', '..', 'sdk', 'lib', library_name, 'dart2js')) | 244 os.path.join('..', '..', '..', 'sdk', 'lib', library_name, 'dart2js')) |
| 217 if 'htmldartium' in systems: | 245 if 'htmldartium' in systems: |
| 218 _logger.info('Generating dartium single files.') | 246 _logger.info('Generating dartium single files.') |
| 219 for library_name in HTML_LIBRARY_NAMES: | 247 for library_name in HTML_LIBRARY_NAMES: |
| 220 GenerateSingleFile( | 248 GenerateSingleFile( |
| 221 os.path.join(dartium_output_dir, '%s_dartium.dart' % library_name), | 249 os.path.join(dartium_output_dir, '%s_dartium.dart' % library_name), |
| 222 os.path.join('..', '..', '..', 'sdk', 'lib', library_name, 'dartium')) | 250 os.path.join('..', '..', '..', 'sdk', 'lib', library_name, 'dartium')) |
| 223 | 251 |
| 224 if __name__ == '__main__': | 252 if __name__ == '__main__': |
| 225 sys.exit(main()) | 253 sys.exit(main()) |
| OLD | NEW |