Chromium Code Reviews| 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): |
|
haraken
2015/01/28 13:02:22
Can we force the interface parameter? I'm wonderin
|
| 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) |
|
Jens Widell
2015/01/28 12:48:31
Nit: I don't know if it makes much sense to use ca
|
| + return lambda suffix: 'V8%s_%s' % (measure_as_name, suffix) |
| + return None |
| # [PerContextEnabled] |