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

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

Issue 9500012: Get rid of GetIDLTypeInfoByName. (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
« no previous file with comments | « client/dom/scripts/generator.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dom/scripts/systemnative.py
diff --git a/client/dom/scripts/systemnative.py b/client/dom/scripts/systemnative.py
index ae75dbcd8e242f543647c188a025c78718820206..38a313fe4f1beb2979fc15e4ac873177876bf4d0 100644
--- a/client/dom/scripts/systemnative.py
+++ b/client/dom/scripts/systemnative.py
@@ -73,7 +73,7 @@ class NativeImplementationSystem(System):
parameters = []
arguments = []
for argument in operation.arguments:
- argument_type_info = GetIDLTypeInfo(argument.type)
+ argument_type_info = GetIDLTypeInfo(argument.type.id)
parameters.append('%s %s' % (argument_type_info.parameter_type(),
argument.id))
arguments.append(argument.id)
@@ -245,7 +245,7 @@ class NativeImplementationGenerator(systemwrapping.WrappingInterfaceGenerator):
def StartInterface(self):
self._class_name = self._ImplClassName(self._interface.id)
- self._interface_type_info = GetIDLTypeInfoByName(self._interface.id)
+ self._interface_type_info = GetIDLTypeInfo(self._interface.id)
self._members_emitter = emitter.Emitter()
self._cpp_declarations_emitter = emitter.Emitter()
self._cpp_impl_includes = {}
@@ -311,7 +311,7 @@ class NativeImplementationGenerator(systemwrapping.WrappingInterfaceGenerator):
function_expression = '%s::%s' % (self._interface_type_info.native_type(), create_function)
invocation = self._GenerateWebCoreInvocation(function_expression, arguments,
- self._interface, self._interface.ext_attrs, raises_dom_exceptions)
+ self._interface.id, self._interface.ext_attrs, raises_dom_exceptions)
self._GenerateNativeCallback(callback_name='constructorCallback',
parameter_definitions=parameter_definitions_emitter.Fragments(),
needs_receiver=False, invocation=invocation,
@@ -404,7 +404,7 @@ class NativeImplementationGenerator(systemwrapping.WrappingInterfaceGenerator):
self._AddSetter(setter)
def _AddGetter(self, attr):
- type_info = GetIDLTypeInfo(attr.type)
+ type_info = GetIDLTypeInfo(attr.type.id)
dart_declaration = '%s get %s()' % (type_info.dart_type(), attr.id)
is_custom = 'Custom' in attr.ext_attrs or 'CustomGetter' in attr.ext_attrs
cpp_callback_name = self._GenerateNativeBinding(attr.id, 1,
@@ -414,7 +414,7 @@ class NativeImplementationGenerator(systemwrapping.WrappingInterfaceGenerator):
arguments = []
if 'Reflect' in attr.ext_attrs:
- webcore_function_name = GetIDLTypeInfo(attr.type).webcore_getter_name()
+ webcore_function_name = GetIDLTypeInfo(attr.type.id).webcore_getter_name()
if 'URL' in attr.ext_attrs:
if 'NonEmpty' in attr.ext_attrs:
webcore_function_name = 'getNonEmptyURLAttribute'
@@ -438,12 +438,12 @@ class NativeImplementationGenerator(systemwrapping.WrappingInterfaceGenerator):
function_expression = self._GenerateWebCoreFunctionExpression(webcore_function_name, attr)
invocation = self._GenerateWebCoreInvocation(function_expression,
- arguments, attr.type, attr.ext_attrs, attr.get_raises)
+ arguments, attr.type.id, attr.ext_attrs, attr.get_raises)
self._GenerateNativeCallback(cpp_callback_name, '', True, invocation,
raises_exceptions=attr.get_raises)
def _AddSetter(self, attr):
- type_info = GetIDLTypeInfo(attr.type)
+ type_info = GetIDLTypeInfo(attr.type.id)
dart_declaration = 'void set %s(%s)' % (attr.id, type_info.dart_type())
is_custom = set(['Custom', 'CustomSetter', 'V8CustomSetter']) & set(attr.ext_attrs)
cpp_callback_name = self._GenerateNativeBinding(attr.id, 2,
@@ -453,7 +453,7 @@ class NativeImplementationGenerator(systemwrapping.WrappingInterfaceGenerator):
arguments = []
if 'Reflect' in attr.ext_attrs:
- webcore_function_name = GetIDLTypeInfo(attr.type).webcore_setter_name()
+ webcore_function_name = GetIDLTypeInfo(attr.type.id).webcore_setter_name()
arguments.append(self._GenerateWebCoreReflectionAttributeName(attr))
else:
webcore_function_name = re.sub(r'^(xml(?=[A-Z])|\w)',
@@ -471,7 +471,7 @@ class NativeImplementationGenerator(systemwrapping.WrappingInterfaceGenerator):
function_expression = self._GenerateWebCoreFunctionExpression(webcore_function_name, attr)
invocation = self._GenerateWebCoreInvocation(function_expression,
- arguments, None, attr.ext_attrs, attr.set_raises)
+ arguments, 'void', attr.ext_attrs, attr.set_raises)
self._GenerateNativeCallback(cpp_callback_name, parameter_definitions,
True, invocation, raises_exceptions=True)
@@ -626,7 +626,7 @@ class NativeImplementationGenerator(systemwrapping.WrappingInterfaceGenerator):
function_expression = self._GenerateWebCoreFunctionExpression(webcore_function_name, operation)
invocation = self._GenerateWebCoreInvocation(function_expression, arguments,
- operation.type, operation.ext_attrs, operation.raises)
+ operation.type.id, operation.ext_attrs, operation.raises)
self._GenerateNativeCallback(cpp_callback_name,
parameter_definitions=parameter_definitions_emitter.Fragments(),
needs_receiver=True, invocation=invocation,
@@ -672,7 +672,7 @@ class NativeImplementationGenerator(systemwrapping.WrappingInterfaceGenerator):
BODY=body)
def _GenerateParameterAdapter(self, emitter, idl_argument, index):
- type_info = GetIDLTypeInfo(idl_argument.type)
+ type_info = GetIDLTypeInfo(idl_argument.type.id)
(adapter_type, include_name) = type_info.parameter_adapter_info()
if include_name:
self._cpp_impl_includes[include_name] = 1
@@ -737,7 +737,7 @@ class NativeImplementationGenerator(systemwrapping.WrappingInterfaceGenerator):
def _GenerateWebCoreInvocation(self, function_expression, arguments,
idl_return_type, attributes, raises_dom_exceptions):
invocation_template = ' $FUNCTION_CALL;\n'
- if idl_return_type and idl_return_type.id != 'void':
+ if idl_return_type != 'void':
return_type_info = GetIDLTypeInfo(idl_return_type)
if return_type_info.conversion_include():
self._cpp_impl_includes[return_type_info.conversion_include()] = 1
« no previous file with comments | « client/dom/scripts/generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698