Index: sdk/lib/html/scripts/htmldartgenerator.py |
diff --git a/sdk/lib/html/scripts/htmldartgenerator.py b/sdk/lib/html/scripts/htmldartgenerator.py |
index 0dd7ab7ae7f89b879efcbdf8226a3cd00e03f5e4..0e109da0f5c80143b3a1f4fee86b4b455e34569d 100644 |
--- a/sdk/lib/html/scripts/htmldartgenerator.py |
+++ b/sdk/lib/html/scripts/htmldartgenerator.py |
@@ -182,17 +182,21 @@ class HtmlDartGenerator(object): |
implements.append('List<%s>' % item_type_info.dart_type()) |
return implements |
- def AddConstructors(self, constructors, factory_provider, class_name, |
- base_class): |
+ def AddConstructors(self, constructors, factory_name, class_name, |
+ base_class, factory_constructor_name=None): |
""" Adds all of the constructors. |
Arguments: |
constructors - List of the constructors to be added. |
- factory_provider - Name of the factory provider for this class. |
+ factory_name - Name of the factory for this class. |
class_name - The name of this class. |
base_class - The name of the base class which this extends. |
+ factory_constructor_name - The name of the constructor on the |
+ factory_name to call (calls an autogenerated FactoryProvider |
+ if unspecified) |
""" |
for constructor_info in constructors: |
- self._AddConstructor(constructor_info, factory_provider) |
+ self._AddConstructor(constructor_info, factory_name, |
+ factory_constructor_name, constructor_info.factory_parameters) |
typed_array_type = None |
for interface in self._database.Hierarchy(self._interface): |
@@ -214,11 +218,14 @@ class HtmlDartGenerator(object): |
' $FACTORY.create$(CTOR)_fromBuffer(buffer, byteOffset, length);\n', |
CTOR=self._interface.id, |
TYPE=self._DartType(typed_array_type), |
- FACTORY=factory_provider) |
- |
- def _AddConstructor(self, constructor_info, factory_provider): |
- constructor_info.GenerateFactoryInvocation( |
- self._DartType, self._members_emitter, factory_provider) |
+ FACTORY=factory_name) |
+ |
+ def _AddConstructor(self, constructor_info, factory_name, |
+ factory_constructor_name, factory_constructor_params): |
+ constructor_info.GenerateFactoryInvocation( |
+ self._DartType, self._members_emitter, factory_name, |
+ factory_constructor_name=factory_constructor_name, |
+ factory_parameters=factory_constructor_params) |
def DeclareAttribute(self, attribute, type_name, attr_name, read_only): |
""" Declares an attribute but does not include the code to invoke it. |