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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/scripts/v8_methods.py ('k') | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_utilities.py
diff --git a/Source/bindings/scripts/v8_utilities.py b/Source/bindings/scripts/v8_utilities.py
index 3dde61cdc3dcc23428add12a222626687629f11e..6a99e9c10d2e36698e19462b39123f61975e5037 100644
--- a/Source/bindings/scripts/v8_utilities.py
+++ b/Source/bindings/scripts/v8_utilities.py
@@ -369,12 +369,18 @@ def cpp_name_or_partial(interface):
# [MeasureAs]
-def measure_as(definition_or_member):
+def measure_as(definition_or_member, interface):
extended_attributes = definition_or_member.extended_attributes
- if 'MeasureAs' not in extended_attributes:
- return None
- includes.add('core/frame/UseCounter.h')
- return extended_attributes['MeasureAs']
+ if 'MeasureAs' in extended_attributes:
+ includes.add('core/frame/UseCounter.h')
+ return lambda suffix: extended_attributes['MeasureAs']
+ if 'Measure' in extended_attributes:
+ includes.add('core/frame/UseCounter.h')
+ measure_as_name = capitalize(definition_or_member.name)
+ if interface is not None:
+ measure_as_name = '%s_%s' % (capitalize(interface.name), measure_as_name)
+ return lambda suffix: 'V8%s_%s' % (measure_as_name, suffix)
+ return None
# [PerContextEnabled]
« 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