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

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: Created 5 years, 11 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
Index: Source/bindings/scripts/v8_utilities.py
diff --git a/Source/bindings/scripts/v8_utilities.py b/Source/bindings/scripts/v8_utilities.py
index c4935d79d17f692a3c5eba27ac07d598fc5a8d93..a9aa9c6e8e3297342247a9895b9eb9188d5383d6 100644
--- a/Source/bindings/scripts/v8_utilities.py
+++ b/Source/bindings/scripts/v8_utilities.py
@@ -367,12 +367,20 @@ def cpp_name_or_partial(interface):
# [MeasureAs]
-def measure_as(definition_or_member):
+def measure_as(definition_or_member, interface=None):
extended_attributes = definition_or_member.extended_attributes
- if 'MeasureAs' not in extended_attributes:
+ if 'DoNotMeasure' 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 or (interface is not None and 'Measure' in interface.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]

Powered by Google App Engine
This is Rietveld 408576698