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

Unified Diff: sdk/lib/html/scripts/systemnative.py

Issue 11365019: Merging dart:html interfaces and implementations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixing merged classes in dartium not compiling under dartc. Created 8 years, 1 month 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 | « sdk/lib/html/scripts/systemhtml.py ('k') | sdk/lib/html/src/dart2js_Conversions.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/scripts/systemnative.py
diff --git a/sdk/lib/html/scripts/systemnative.py b/sdk/lib/html/scripts/systemnative.py
index 55477de15cb4c4366b78a1a5a8615e10aebda335..7155f29183a78748b268d39ed9811e4e4bbd0a75 100644
--- a/sdk/lib/html/scripts/systemnative.py
+++ b/sdk/lib/html/scripts/systemnative.py
@@ -10,11 +10,14 @@ import emitter
import os
from generator import *
from systemhtml import SecureOutputType
+from htmldartgenerator import *
-class DartiumBackend(object):
+class DartiumBackend(HtmlDartGenerator):
"""Generates Dart implementation for one DOM IDL interface."""
def __init__(self, interface, cpp_library_emitter, options):
+ super(DartiumBackend, self).__init__(interface, options)
+
self._interface = interface
self._cpp_library_emitter = cpp_library_emitter
self._database = options.database
@@ -104,9 +107,6 @@ class DartiumBackend(object):
def RootClassName(self):
return 'NativeFieldWrapperClass1'
- def AdditionalImplementedInterfaces(self):
- return []
-
def NativeSpec(self):
return ''
@@ -209,6 +209,20 @@ class DartiumBackend(object):
ARGUMENTS=constructor_info.ParametersAsArgumentList(),
NATIVE_NAME=native_binding)
+ def AddConstructors(self, constructors, factory_provider, class_name,
+ base_class):
+ super(DartiumBackend, self).AddConstructors(constructors, factory_provider,
+ class_name, base_class)
+
+ super_constructor = ''
+ if base_class and base_class != 'NativeFieldWrapperClass1':
+ super_constructor = ': super.internal()'
+
+ self._members_emitter.Emit(
+ ' $CLASSNAME.internal()$SUPERCONSTRUCTOR;\n',
+ CLASSNAME=class_name,
+ SUPERCONSTRUCTOR=super_constructor)
+
def FinishInterface(self):
self._GenerateCPPHeader()
@@ -462,6 +476,13 @@ class DartiumBackend(object):
else:
self._GenerateDispatcher(info.operations, dart_declaration, [info.name for info in info.param_infos])
+ def AddConstant(self, constant):
+ type = TypeOrNothing(self._DartType(constant.type.id), constant.type.id)
+ self._members_emitter.Emit('\n static const $TYPE$NAME = $VALUE;\n',
+ NAME=constant.id,
+ TYPE=type,
+ VALUE=constant.value)
+
def _GenerateDispatcher(self, operations, dart_declaration, argument_names):
body = self._members_emitter.Emit(
@@ -757,8 +778,12 @@ class DartiumBackend(object):
native_binding = '%s_%s_%s' % (self._interface.id, idl_name, native_suffix)
self._members_emitter.Emit(
'\n'
- ' $DART_DECLARATION native "$NATIVE_BINDING";\n',
- DART_DECLARATION=dart_declaration, NATIVE_BINDING=native_binding)
+ '\n /** @domName $DOMINTERFACE.$DOMNAME */'
+ '\n $DART_DECLARATION native "$NATIVE_BINDING";\n',
+ DOMINTERFACE=self._interface.id,
+ DOMNAME=idl_name,
+ DART_DECLARATION=dart_declaration,
+ NATIVE_BINDING=native_binding)
cpp_callback_name = '%s%s' % (idl_name, native_suffix)
self._cpp_resolver_emitter.Emit(
« no previous file with comments | « sdk/lib/html/scripts/systemhtml.py ('k') | sdk/lib/html/src/dart2js_Conversions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698