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

Side by Side Diff: lib/dom/scripts/systemnative.py

Issue 10206017: Do not use overloaded toDartValue for bindings classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/dom/scripts/generator.py ('k') | lib/dom/templates/dom/native/cpp_header.template » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """This module provides shared functionality for the systems to generate 6 """This module provides shared functionality for the systems to generate
7 native binding from the IDL database.""" 7 native binding from the IDL database."""
8 8
9 import emitter 9 import emitter
10 import os 10 import os
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 ' {\n' 389 ' {\n'
390 ' return DartDOMWrapper::unwrapDartWrapper<Dart$INTERFACE>(hand le, exception);\n' 390 ' return DartDOMWrapper::unwrapDartWrapper<Dart$INTERFACE>(hand le, exception);\n'
391 ' }\n') 391 ' }\n')
392 392
393 if ('CustomToJS' in self._interface.ext_attrs or 393 if ('CustomToJS' in self._interface.ext_attrs or
394 'CustomToJSObject' in self._interface.ext_attrs or 394 'CustomToJSObject' in self._interface.ext_attrs or
395 'PureInterface' in self._interface.ext_attrs or 395 'PureInterface' in self._interface.ext_attrs or
396 'CPPPureInterface' in self._interface.ext_attrs or 396 'CPPPureInterface' in self._interface.ext_attrs or
397 self._interface_type_info.custom_to_dart()): 397 self._interface_type_info.custom_to_dart()):
398 to_dart_template = ( 398 to_dart_template = (
399 'Dart_Handle toDartValue($(WEBCORE_CLASS_NAME)* value);\n') 399 ' static Dart_Handle toDart($(WEBCORE_CLASS_NAME)* value);\n')
400 else: 400 else:
401 to_dart_template = ( 401 to_dart_template = (
402 'inline Dart_Handle toDartValue($(WEBCORE_CLASS_NAME)* value)\n' 402 ' static Dart_Handle toDart($(WEBCORE_CLASS_NAME)* value)\n'
403 '{\n' 403 ' {\n'
404 ' return DartDOMWrapper::toDart<Dart$(INTERFACE)>(value);\n' 404 ' return DartDOMWrapper::toDart<Dart$(INTERFACE)>(value);\n'
405 '}\n') 405 ' }\n')
406 406
407 intermediate_emitter = emitter.Emitter() 407 intermediate_emitter = emitter.Emitter()
408 intermediate_emitter.Emit( 408 intermediate_emitter.Emit(
409 self._templates.Load('cpp_header.template'), 409 self._templates.Load('cpp_header.template'),
410 TO_NATIVE=to_native_template, 410 TO_NATIVE=to_native_template,
411 TO_DART=to_dart_template) 411 TO_DART=to_dart_template)
412 412
413 webcore_includes = _GenerateCPPIncludes(self._interface_type_info.webcore_in cludes()) 413 webcore_includes = _GenerateCPPIncludes(self._interface_type_info.webcore_in cludes())
414 wrapper_type = _DOMWrapperType(self._system._database, self._interface) 414 wrapper_type = _DOMWrapperType(self._system._database, self._interface)
415 self._cpp_header_emitter.Emit( 415 self._cpp_header_emitter.Emit(
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 def _InstanceOfNode(database, interface): 846 def _InstanceOfNode(database, interface):
847 if interface.id == 'Node': 847 if interface.id == 'Node':
848 return True 848 return True
849 for parent in interface.parents: 849 for parent in interface.parents:
850 if not database.HasInterface(parent.type.id): 850 if not database.HasInterface(parent.type.id):
851 continue 851 continue
852 parent_interface = database.GetInterface(parent.type.id) 852 parent_interface = database.GetInterface(parent.type.id)
853 if _InstanceOfNode(database, parent_interface): 853 if _InstanceOfNode(database, parent_interface):
854 return True 854 return True
855 return False 855 return False
OLDNEW
« no previous file with comments | « lib/dom/scripts/generator.py ('k') | lib/dom/templates/dom/native/cpp_header.template » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698