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

Unified Diff: client/dom/scripts/generator.py

Issue 9565006: Add missing includes (spotted while splitting cpp derived sources). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: client/dom/scripts/generator.py
diff --git a/client/dom/scripts/generator.py b/client/dom/scripts/generator.py
index 2a678ba393342a5a2d23c53aa3d0ac5fd32aa76b..69a552f2652215740ce5def94b9cd46bad070032 100644
--- a/client/dom/scripts/generator.py
+++ b/client/dom/scripts/generator.py
@@ -485,18 +485,24 @@ class IDLTypeInfo(object):
def parameter_type(self):
return '%s*' % self.native_type()
- def webcore_include(self):
+ def webcore_includes(self):
+ if not self._idl_type.startswith('SVG'):
+ return [self._idl_type]
+
if self._idl_type == 'SVGNumber' or self._idl_type == 'SVGPoint':
antonm 2012/03/01 14:25:31 maybe, as you're touching it anyway, self._idl_typ
podivilov 2012/03/01 15:36:56 Done.
- return None
+ return []
+ includes = _svg_supplemental_includes
if self._idl_type.startswith('SVGPathSeg'):
- return self._idl_type.replace('Abs', '').replace('Rel', '')
- return self._idl_type
+ includes.append(self._idl_type.replace('Abs', '').replace('Rel', ''))
antonm 2012/03/01 14:25:31 maybe make it additional_include = self._idl_type.
podivilov 2012/03/01 15:36:56 Done.
+ else:
+ includes.append(self._idl_type)
+ return includes
def receiver(self):
return 'receiver->'
def conversion_include(self):
- return 'Dart%s' % self._idl_type
+ return 'Dart%s' % self.dart_type()
def conversion_cast(self, expression):
if self._conversion_template:
@@ -608,6 +614,7 @@ _idl_type_registry = {
'HTMLElement': IDLTypeInfo('HTMLElement', custom_to_dart=True),
'MediaQueryListListener': IDLTypeInfo('MediaQueryListListener', has_dart_wrapper=False),
'OptionsObject': IDLTypeInfo('OptionsObject', has_dart_wrapper=False),
+ 'StyleSheet': IDLTypeInfo('StyleSheet', conversion_template='static_cast<StyleSheet*>(%s)'),
'SVGElement': IDLTypeInfo('SVGElement', custom_to_dart=True),
'SVGAngle': SVGTearOffIDLTypeInfo('SVGAngle'),
@@ -626,6 +633,15 @@ _idl_type_registry = {
'SVGTransformList': SVGTearOffIDLTypeInfo('SVGTransformList', native_type='SVGTransformListPropertyTearOff', ref_counted=False)
}
+_svg_supplemental_includes = [
+ 'SVGAnimatedPropertyTearOff',
+ 'SVGAnimatedListPropertyTearOff',
+ 'SVGStaticListPropertyTearOff',
+ 'SVGAnimatedListPropertyTearOff',
+ 'SVGTransformListPropertyTearOff',
+ 'SVGPathSegListPropertyTearOff',
+]
+
def GetIDLTypeInfo(idl_type):
return GetIDLTypeInfoByName(idl_type.id)

Powered by Google App Engine
This is Rietveld 408576698