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

Side by Side Diff: Source/bindings/scripts/v8_utilities.py

Issue 229373006: Support optional, non-defaulted constructor arguments. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Formatting Created 6 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
« no previous file with comments | « Source/bindings/scripts/v8_methods.py ('k') | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 for enum_value in idl_type.enum_values]) 106 for enum_value in idl_type.enum_values])
107 IdlType.enum_validation_expression = property(enum_validation_expression) 107 IdlType.enum_validation_expression = property(enum_validation_expression)
108 108
109 109
110 def scoped_name(interface, definition, base_name): 110 def scoped_name(interface, definition, base_name):
111 # partial interfaces are implemented as separate classes, with their members 111 # partial interfaces are implemented as separate classes, with their members
112 # implemented as static member functions 112 # implemented as static member functions
113 partial_interface_implemented_as = definition.extended_attributes.get('Parti alInterfaceImplementedAs') 113 partial_interface_implemented_as = definition.extended_attributes.get('Parti alInterfaceImplementedAs')
114 if partial_interface_implemented_as: 114 if partial_interface_implemented_as:
115 return '%s::%s' % (partial_interface_implemented_as, base_name) 115 return '%s::%s' % (partial_interface_implemented_as, base_name)
116 if definition.is_static: 116 if (definition.is_static or
117 definition.name in ('Constructor', 'NamedConstructor')):
117 return '%s::%s' % (cpp_name(interface), base_name) 118 return '%s::%s' % (cpp_name(interface), base_name)
118 return 'impl->%s' % base_name 119 return 'impl->%s' % base_name
119 120
120 121
121 def v8_class_name(interface): 122 def v8_class_name(interface):
122 return v8_types.v8_type(interface.name) 123 return v8_types.v8_type(interface.name)
123 124
124 125
125 ################################################################################ 126 ################################################################################
126 # Specific extended attributes 127 # Specific extended attributes
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 234
234 The returned function checks if a method/attribute is enabled. 235 The returned function checks if a method/attribute is enabled.
235 Given extended attribute RuntimeEnabled=FeatureName, return: 236 Given extended attribute RuntimeEnabled=FeatureName, return:
236 RuntimeEnabledFeatures::{featureName}Enabled 237 RuntimeEnabledFeatures::{featureName}Enabled
237 """ 238 """
238 extended_attributes = definition_or_member.extended_attributes 239 extended_attributes = definition_or_member.extended_attributes
239 if 'RuntimeEnabled' not in extended_attributes: 240 if 'RuntimeEnabled' not in extended_attributes:
240 return None 241 return None
241 feature_name = extended_attributes['RuntimeEnabled'] 242 feature_name = extended_attributes['RuntimeEnabled']
242 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) 243 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name)
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_methods.py ('k') | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698