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

Side by Side Diff: sky/engine/bindings/scripts/dart_methods.py

Issue 936193005: Make it possible to inherit from any constructable host object (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Remove extra comment Created 5 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 unified diff | Download patch
OLDNEW
1 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 }) 99 })
100 return context 100 return context
101 101
102 def argument_context(interface, method, argument, index): 102 def argument_context(interface, method, argument, index):
103 context = v8_methods.argument_context(interface, method, argument, index) 103 context = v8_methods.argument_context(interface, method, argument, index)
104 104
105 extended_attributes = argument.extended_attributes 105 extended_attributes = argument.extended_attributes
106 idl_type = argument.idl_type 106 idl_type = argument.idl_type
107 this_cpp_value = cpp_value(interface, method, index) 107 this_cpp_value = cpp_value(interface, method, index)
108 auto_scope = not 'DartNoAutoScope' in extended_attributes 108 auto_scope = not 'DartNoAutoScope' in extended_attributes
109 arg_index = index + 1 if not (method.is_static or method.is_constructor) els e index 109 arg_index = index + 1 if not method.is_static else index
110 preprocessed_type = str(idl_type.preprocessed_type) 110 preprocessed_type = str(idl_type.preprocessed_type)
111 local_cpp_type = idl_type.cpp_type_args(argument.extended_attributes, raw_ty pe=True) 111 local_cpp_type = idl_type.cpp_type_args(argument.extended_attributes, raw_ty pe=True)
112 default_value = argument.default_cpp_value 112 default_value = argument.default_cpp_value
113 if context['has_default']: 113 if context['has_default']:
114 default_value = (argument.default_cpp_value or 114 default_value = (argument.default_cpp_value or
115 dart_types.default_cpp_value_for_cpp_type(idl_type)) 115 dart_types.default_cpp_value_for_cpp_type(idl_type))
116 dart_type = dart_types.idl_type_to_dart_type(idl_type) 116 dart_type = dart_types.idl_type_to_dart_type(idl_type)
117 dart_default_value = dart_types.dart_default_value(dart_type, argument) 117 dart_default_value = dart_types.dart_default_value(dart_type, argument)
118 context.update({ 118 context.update({
119 'cpp_type': idl_type.cpp_type_args(extended_attributes=extended_attribut es, 119 'cpp_type': idl_type.cpp_type_args(extended_attributes=extended_attribut es,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 # removeEventListener methods that should be added in somewhere. 237 # removeEventListener methods that should be added in somewhere.
238 # There is also some logic in systemnative.py to force a null check 238 # There is also some logic in systemnative.py to force a null check
239 # for the useCapture argument of those same methods that we may need to 239 # for the useCapture argument of those same methods that we may need to
240 # pull over. 240 # pull over.
241 null_check = ((argument.is_optional and idl_type.is_callback_interface) or 241 null_check = ((argument.is_optional and idl_type.is_callback_interface) or
242 (argument.default_value and argument.default_value.is_null)) 242 (argument.default_value and argument.default_value.is_null))
243 243
244 return idl_type.dart_value_to_local_cpp_value( 244 return idl_type.dart_value_to_local_cpp_value(
245 extended_attributes, name, null_check, has_type_checking_interface, 245 extended_attributes, name, null_check, has_type_checking_interface,
246 index=index, auto_scope=auto_scope) 246 index=index, auto_scope=auto_scope)
OLDNEW
« no previous file with comments | « no previous file | sky/engine/bindings/scripts/templates/interface_dart.template » ('j') | sky/engine/tonic/dart_wrappable.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698