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

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

Issue 877523004: Add extended attribute, [Measure], to simplify use counting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove inheritance of [Measure] Created 5 years, 9 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 362
363 363
364 def cpp_name_or_partial(interface): 364 def cpp_name_or_partial(interface):
365 cpp_class_name = cpp_name(interface) 365 cpp_class_name = cpp_name(interface)
366 if interface.is_partial: 366 if interface.is_partial:
367 return ''.join([cpp_class_name, 'Partial']) 367 return ''.join([cpp_class_name, 'Partial'])
368 return cpp_class_name 368 return cpp_class_name
369 369
370 370
371 # [MeasureAs] 371 # [MeasureAs]
372 def measure_as(definition_or_member): 372 def measure_as(definition_or_member, interface):
373 extended_attributes = definition_or_member.extended_attributes 373 extended_attributes = definition_or_member.extended_attributes
374 if 'MeasureAs' not in extended_attributes: 374 if 'MeasureAs' in extended_attributes:
375 return None 375 includes.add('core/frame/UseCounter.h')
376 includes.add('core/frame/UseCounter.h') 376 return lambda suffix: extended_attributes['MeasureAs']
377 return extended_attributes['MeasureAs'] 377 if 'Measure' in extended_attributes:
378 includes.add('core/frame/UseCounter.h')
379 measure_as_name = capitalize(definition_or_member.name)
380 if interface is not None:
381 measure_as_name = '%s_%s' % (capitalize(interface.name), measure_as_ name)
382 return lambda suffix: 'V8%s_%s' % (measure_as_name, suffix)
383 return None
378 384
379 385
380 # [PerContextEnabled] 386 # [PerContextEnabled]
381 def per_context_enabled_function_name(definition_or_member): 387 def per_context_enabled_function_name(definition_or_member):
382 extended_attributes = definition_or_member.extended_attributes 388 extended_attributes = definition_or_member.extended_attributes
383 if 'PerContextEnabled' not in extended_attributes: 389 if 'PerContextEnabled' not in extended_attributes:
384 return None 390 return None
385 feature_name = extended_attributes['PerContextEnabled'] 391 feature_name = extended_attributes['PerContextEnabled']
386 return 'ContextFeatures::%sEnabled' % uncapitalize(feature_name) 392 return 'ContextFeatures::%sEnabled' % uncapitalize(feature_name)
387 393
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 except StopIteration: 508 except StopIteration:
503 return None 509 return None
504 510
505 511
506 IdlInterface.indexed_property_getter = property(indexed_property_getter) 512 IdlInterface.indexed_property_getter = property(indexed_property_getter)
507 IdlInterface.indexed_property_setter = property(indexed_property_setter) 513 IdlInterface.indexed_property_setter = property(indexed_property_setter)
508 IdlInterface.indexed_property_deleter = property(indexed_property_deleter) 514 IdlInterface.indexed_property_deleter = property(indexed_property_deleter)
509 IdlInterface.named_property_getter = property(named_property_getter) 515 IdlInterface.named_property_getter = property(named_property_getter)
510 IdlInterface.named_property_setter = property(named_property_setter) 516 IdlInterface.named_property_setter = property(named_property_setter)
511 IdlInterface.named_property_deleter = property(named_property_deleter) 517 IdlInterface.named_property_deleter = property(named_property_deleter)
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