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

Unified Diff: lib/dom/scripts/systemnative.py

Issue 10834271: Support typed arrays constructor templates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698