| OLD | NEW |
| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 if 'Conditional' not in extended_attributes: | 225 if 'Conditional' not in extended_attributes: |
| 226 return None | 226 return None |
| 227 return 'ENABLE(%s)' % extended_attributes['Conditional'] | 227 return 'ENABLE(%s)' % extended_attributes['Conditional'] |
| 228 | 228 |
| 229 | 229 |
| 230 # [DeprecateAs] | 230 # [DeprecateAs] |
| 231 def deprecate_as(member): | 231 def deprecate_as(member): |
| 232 extended_attributes = member.extended_attributes | 232 extended_attributes = member.extended_attributes |
| 233 if 'DeprecateAs' not in extended_attributes: | 233 if 'DeprecateAs' not in extended_attributes: |
| 234 return None | 234 return None |
| 235 includes.add('core/frame/UseCounter.h') | |
| 236 return extended_attributes['DeprecateAs'] | 235 return extended_attributes['DeprecateAs'] |
| 237 | 236 |
| 238 | 237 |
| 239 # [Exposed] | 238 # [Exposed] |
| 240 EXPOSED_EXECUTION_CONTEXT_METHOD = { | 239 EXPOSED_EXECUTION_CONTEXT_METHOD = { |
| 241 'Window': 'isDocument', | 240 'Window': 'isDocument', |
| 242 } | 241 } |
| 243 | 242 |
| 244 | 243 |
| 245 def exposed(definition_or_member, interface): | 244 def exposed(definition_or_member, interface): |
| (...skipping 29 matching lines...) Expand all Loading... |
| 275 if 'ImplementedAs' not in extended_attributes: | 274 if 'ImplementedAs' not in extended_attributes: |
| 276 return definition_or_member.name | 275 return definition_or_member.name |
| 277 return extended_attributes['ImplementedAs'] | 276 return extended_attributes['ImplementedAs'] |
| 278 | 277 |
| 279 | 278 |
| 280 # [MeasureAs] | 279 # [MeasureAs] |
| 281 def measure_as(definition_or_member): | 280 def measure_as(definition_or_member): |
| 282 extended_attributes = definition_or_member.extended_attributes | 281 extended_attributes = definition_or_member.extended_attributes |
| 283 if 'MeasureAs' not in extended_attributes: | 282 if 'MeasureAs' not in extended_attributes: |
| 284 return None | 283 return None |
| 285 includes.add('core/frame/UseCounter.h') | |
| 286 return extended_attributes['MeasureAs'] | 284 return extended_attributes['MeasureAs'] |
| 287 | 285 |
| 288 | 286 |
| 289 # [RuntimeEnabled] | 287 # [RuntimeEnabled] |
| 290 def runtime_enabled_function_name(definition_or_member): | 288 def runtime_enabled_function_name(definition_or_member): |
| 291 """Returns the name of the RuntimeEnabledFeatures function. | 289 """Returns the name of the RuntimeEnabledFeatures function. |
| 292 | 290 |
| 293 The returned function checks if a method/attribute is enabled. | 291 The returned function checks if a method/attribute is enabled. |
| 294 Given extended attribute RuntimeEnabled=FeatureName, return: | 292 Given extended attribute RuntimeEnabled=FeatureName, return: |
| 295 RuntimeEnabledFeatures::{featureName}Enabled | 293 RuntimeEnabledFeatures::{featureName}Enabled |
| 296 """ | 294 """ |
| 297 extended_attributes = definition_or_member.extended_attributes | 295 extended_attributes = definition_or_member.extended_attributes |
| 298 if 'RuntimeEnabled' not in extended_attributes: | 296 if 'RuntimeEnabled' not in extended_attributes: |
| 299 return None | 297 return None |
| 300 feature_name = extended_attributes['RuntimeEnabled'] | 298 feature_name = extended_attributes['RuntimeEnabled'] |
| 301 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) | 299 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) |
| OLD | NEW |