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

Side by Side Diff: tools/dom/scripts/generator.py

Issue 671023003: More dart:blink entry point tweaks (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Static permission getter Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, 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 module provides shared functionality for systems to generate 6 """This module provides shared functionality for systems to generate
7 Dart APIs from the IDL database.""" 7 Dart APIs from the IDL database."""
8 8
9 import copy 9 import copy
10 import json 10 import json
11 import monitored 11 import monitored
12 import os 12 import os
13 import re 13 import re
14 from htmlrenamer import custom_html_constructors, html_interface_renames, \ 14 from htmlrenamer import custom_html_constructors, html_interface_renames, \
15 typed_array_renames 15 typed_array_renames
16 16
17 _pure_interfaces = monitored.Set('generator._pure_interfaces', [ 17 _pure_interfaces = monitored.Set('generator._pure_interfaces', [
18 # TODO(sra): DOMStringMap should be a class implementing Map<String,String>. 18 # TODO(sra): DOMStringMap should be a class implementing Map<String,String>.
19 'DOMStringMap', 19 'DOMStringMap',
20 'AbstractWorker',
20 'CanvasPathMethods', 21 'CanvasPathMethods',
21 'ChildNode', 22 'ChildNode',
23 'DocumentAnimation',
24 'DocumentFontFaceSet',
25 'DocumentFullscreen',
26 'DocumentXPathEvaluator',
27 'ElementAnimation',
28 'ElementFullscreen',
22 'EventListener', 29 'EventListener',
23 'GlobalEventHandlers', 30 'GlobalEventHandlers',
31 'ImageBitmapFactories',
24 'MediaQueryListListener', 32 'MediaQueryListListener',
33 'MouseEventHitRegion',
25 'MutationCallback', 34 'MutationCallback',
35 'NavigatorCPU',
36 'NavigatorEvents',
26 'NavigatorID', 37 'NavigatorID',
38 'NavigatorLanguage',
27 'NavigatorOnLine', 39 'NavigatorOnLine',
28 'ParentNode', 40 'ParentNode',
41 'SVGDocument',
29 'SVGExternalResourcesRequired', 42 'SVGExternalResourcesRequired',
30 'SVGFilterPrimitiveStandardAttributes', 43 'SVGFilterPrimitiveStandardAttributes',
31 'SVGFitToViewBox', 44 'SVGFitToViewBox',
32 'SVGTests', 45 'SVGTests',
33 'SVGURIReference', 46 'SVGURIReference',
34 'SVGZoomAndPan', 47 'SVGZoomAndPan',
35 'TimeoutHandler', 48 'TimeoutHandler',
36 'URLUtils', 49 'URLUtils',
37 'URLUtilsReadOnly', 50 'URLUtilsReadOnly',
38 'WebGLRenderingContextBase', 51 'WebGLRenderingContextBase',
39 'WindowBase64', 52 'WindowBase64',
40 'WindowEventHandlers', 53 'WindowEventHandlers',
54 'WindowImageBitmapFactories',
55 'WindowPagePopup',
41 'WindowTimers', 56 'WindowTimers',
42 ]) 57 ])
43 58
44 def IsPureInterface(interface_name): 59 def IsPureInterface(interface_name):
45 return interface_name in _pure_interfaces 60 return interface_name in _pure_interfaces
46 61
47 # 62 #
48 # Classes which have native constructors but which we are suppressing because 63 # Classes which have native constructors but which we are suppressing because
49 # they are not cross-platform. 64 # they are not cross-platform.
50 # 65 #
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 if type_data.clazz == 'BasicTypedList': 1341 if type_data.clazz == 'BasicTypedList':
1327 if type_name == 'ArrayBuffer': 1342 if type_name == 'ArrayBuffer':
1328 dart_interface_name = 'ByteBuffer' 1343 dart_interface_name = 'ByteBuffer'
1329 else: 1344 else:
1330 dart_interface_name = self._renamer.RenameInterfaceId(type_name) 1345 dart_interface_name = self._renamer.RenameInterfaceId(type_name)
1331 return BasicTypedListIDLTypeInfo( 1346 return BasicTypedListIDLTypeInfo(
1332 type_name, type_data, dart_interface_name, self) 1347 type_name, type_data, dart_interface_name, self)
1333 1348
1334 class_name = '%sIDLTypeInfo' % type_data.clazz 1349 class_name = '%sIDLTypeInfo' % type_data.clazz
1335 return globals()[class_name](type_name, type_data) 1350 return globals()[class_name](type_name, type_data)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698