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

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

Issue 21555003: Exposing native doubles as doubles when they are read-only or method return values. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 | « tools/dom/scripts/systemhtml.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/systemnative.py
diff --git a/tools/dom/scripts/systemnative.py b/tools/dom/scripts/systemnative.py
index 91dd1807a3e087b649fdb3443e6e6604b0c1371b..65ce3d80295ab89fe74679b08d2ef3ee1fbd0763 100644
--- a/tools/dom/scripts/systemnative.py
+++ b/tools/dom/scripts/systemnative.py
@@ -376,18 +376,18 @@ class DartiumBackend(HtmlDartGenerator):
TO_DART=to_dart_emitter.Fragments())
def EmitAttribute(self, attribute, html_name, read_only):
- self._AddGetter(attribute, html_name)
+ self._AddGetter(attribute, html_name, read_only)
if not read_only:
self._AddSetter(attribute, html_name)
- def _AddGetter(self, attr, html_name):
+ def _AddGetter(self, attr, html_name, read_only):
# Temporary hack to force dart:scalarlist clamped array for ImageData.data.
# TODO(antonm): solve in principled way.
if self._interface.id == 'ImageData' and html_name == 'data':
html_name = '_data'
type_info = self._TypeInfo(attr.type.id)
dart_declaration = '%s get %s' % (
- self.SecureOutputType(attr.type.id), html_name)
+ self.SecureOutputType(attr.type.id, False, read_only), html_name)
is_custom = 'Custom' in attr.ext_attrs or 'CustomGetter' in attr.ext_attrs
cpp_callback_name = self._GenerateNativeBinding(attr.id, 1,
dart_declaration, 'Getter', is_custom)
@@ -561,7 +561,7 @@ class DartiumBackend(HtmlDartGenerator):
dart_declaration = '%s%s %s(%s)' % (
'static ' if info.IsStatic() else '',
- self.SecureOutputType(info.type_name),
+ self.SecureOutputType(info.type_name, False, True),
html_name,
info.ParametersDeclaration(self._DartType))
@@ -1014,13 +1014,6 @@ class DartiumBackend(HtmlDartGenerator):
lambda s: 'is' + s.group(1).capitalize(),
name)
- def _TypeInfo(self, type_name):
- return self._type_registry.TypeInfo(type_name)
-
- def _DartType(self, type_name):
- return self._type_registry.DartType(type_name)
-
-
class CPPLibraryEmitter():
def __init__(self, emitters, cpp_sources_dir):
self._emitters = emitters
« no previous file with comments | « tools/dom/scripts/systemhtml.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698