Chromium Code Reviews| Index: lib/dom/scripts/systemnative.py |
| diff --git a/lib/dom/scripts/systemnative.py b/lib/dom/scripts/systemnative.py |
| index a125782a4b35707302702ea979594e1dfc811a4e..b7b1a85760e26b0031d671640ab3d02e98d68eee 100644 |
| --- a/lib/dom/scripts/systemnative.py |
| +++ b/lib/dom/scripts/systemnative.py |
| @@ -245,6 +245,17 @@ class NativeImplementationGenerator(systembase.BaseGenerator): |
| 'void constructorCallback(Dart_NativeArguments);\n') |
| return |
| + if ext_attrs.get('ConstructorTemplate') == 'TypedArray': |
| + self._cpp_impl_includes.add('"DartArrayBufferViewCustom.h"'); |
| + self._cpp_definitions_emitter.Emit( |
| + '\n' |
| + 'static void constructorCallback(Dart_NativeArguments args)\n' |
| + '{\n' |
| + ' WebCore::DartArrayBufferViewInternal::constructWebGLArray<Dart$(INTERFACE_NAME)>(args);\n' |
| + '}\n', |
| + INTERFACE_NAME=self._interface.id); |
| + return |
| + |
| create_function = 'create' |
| if 'NamedConstructor' in ext_attrs: |
| create_function = 'createForJSConstructor' |
| @@ -282,9 +293,23 @@ class NativeImplementationGenerator(systembase.BaseGenerator): |
| return self._ImplClassName(supertype) |
| + ATTRIBUTES_OF_CONSTRUCTABLE = set([ |
|
podivilov
2012/08/21 12:36:27
Please move to the top of the file.
Anton Muhin
2012/08/21 18:15:55
I am somewhat concerned with moving it far away fr
|
| + 'CustomConstructor', |
| + 'V8CustomConstructor', |
| + 'Constructor', |
| + 'NamedConstructor']) |
| + |
| def _IsConstructable(self): |
| - # FIXME: support ConstructorTemplate. |
| - return set(['CustomConstructor', 'V8CustomConstructor', 'Constructor', 'NamedConstructor']) & set(self._interface.ext_attrs) |
| + ext_attrs = self._interface.ext_attrs |
| + |
| + if self.ATTRIBUTES_OF_CONSTRUCTABLE & set(ext_attrs): |
| + return True |
| + |
| + # FIXME: support other types of ConstructorTemplate. |
| + if ext_attrs.get('ConstructorTemplate') == 'TypedArray': |
| + return True |
| + |
| + return False |
| def EmitFactoryProvider(self, constructor_info, factory_provider, emitter): |
| template_file = 'factoryprovider_%s.darttemplate' % self._html_interface_name |