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

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

Issue 618373003: [bindings] partial interfaces should not violate componentization (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed patch conflict Created 6 years, 2 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 | « Source/bindings/scripts/v8_methods.py ('k') | Source/bindings/templates/attributes.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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 if (definition.is_static or 138 if (definition.is_static or
139 definition.name in ('Constructor', 'NamedConstructor')): 139 definition.name in ('Constructor', 'NamedConstructor')):
140 return '%s::%s' % (cpp_name(interface), base_name) 140 return '%s::%s' % (cpp_name(interface), base_name)
141 return 'impl->%s' % base_name 141 return 'impl->%s' % base_name
142 142
143 143
144 def v8_class_name(interface): 144 def v8_class_name(interface):
145 return v8_types.v8_type(interface.name) 145 return v8_types.v8_type(interface.name)
146 146
147 147
148 def v8_class_name_or_partial(interface):
149 class_name = v8_class_name(interface)
150 if interface.is_partial:
151 return ''.join([class_name, 'Partial'])
152 return class_name
153
154
148 ################################################################################ 155 ################################################################################
149 # Specific extended attributes 156 # Specific extended attributes
150 ################################################################################ 157 ################################################################################
151 158
152 # [ActivityLogging] 159 # [ActivityLogging]
153 def activity_logging_world_list(member, access_type=''): 160 def activity_logging_world_list(member, access_type=''):
154 """Returns a set of world suffixes for which a definition member has activit y logging, for specified access type. 161 """Returns a set of world suffixes for which a definition member has activit y logging, for specified access type.
155 162
156 access_type can be 'Getter' or 'Setter' if only checking getting or setting. 163 access_type can be 'Getter' or 'Setter' if only checking getting or setting.
157 """ 164 """
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 296
290 297
291 # [ImplementedAs] 298 # [ImplementedAs]
292 def cpp_name(definition_or_member): 299 def cpp_name(definition_or_member):
293 extended_attributes = definition_or_member.extended_attributes 300 extended_attributes = definition_or_member.extended_attributes
294 if 'ImplementedAs' not in extended_attributes: 301 if 'ImplementedAs' not in extended_attributes:
295 return definition_or_member.name 302 return definition_or_member.name
296 return extended_attributes['ImplementedAs'] 303 return extended_attributes['ImplementedAs']
297 304
298 305
306 def cpp_name_or_partial(interface):
307 cpp_class_name = cpp_name(interface)
308 if interface.is_partial:
309 return ''.join([cpp_class_name, 'Partial'])
310 return cpp_class_name
311
312
299 # [MeasureAs] 313 # [MeasureAs]
300 def measure_as(definition_or_member): 314 def measure_as(definition_or_member):
301 extended_attributes = definition_or_member.extended_attributes 315 extended_attributes = definition_or_member.extended_attributes
302 if 'MeasureAs' not in extended_attributes: 316 if 'MeasureAs' not in extended_attributes:
303 return None 317 return None
304 includes.add('core/frame/UseCounter.h') 318 includes.add('core/frame/UseCounter.h')
305 return extended_attributes['MeasureAs'] 319 return extended_attributes['MeasureAs']
306 320
307 321
308 # [PerContextEnabled] 322 # [PerContextEnabled]
(...skipping 11 matching lines...) Expand all
320 334
321 The returned function checks if a method/attribute is enabled. 335 The returned function checks if a method/attribute is enabled.
322 Given extended attribute RuntimeEnabled=FeatureName, return: 336 Given extended attribute RuntimeEnabled=FeatureName, return:
323 RuntimeEnabledFeatures::{featureName}Enabled 337 RuntimeEnabledFeatures::{featureName}Enabled
324 """ 338 """
325 extended_attributes = definition_or_member.extended_attributes 339 extended_attributes = definition_or_member.extended_attributes
326 if 'RuntimeEnabled' not in extended_attributes: 340 if 'RuntimeEnabled' not in extended_attributes:
327 return None 341 return None
328 feature_name = extended_attributes['RuntimeEnabled'] 342 feature_name = extended_attributes['RuntimeEnabled']
329 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) 343 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name)
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_methods.py ('k') | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698