| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 exposure_checks.append('context->%s()' % EXPOSED_EXECUTION_CONTEXT_METHO
D[environment]) | 262 exposure_checks.append('context->%s()' % EXPOSED_EXECUTION_CONTEXT_METHO
D[environment]) |
| 263 | 263 |
| 264 return ' || '.join(exposure_checks) | 264 return ' || '.join(exposure_checks) |
| 265 | 265 |
| 266 | 266 |
| 267 def expanded_exposure_set_for_interface(interface): | 267 def expanded_exposure_set_for_interface(interface): |
| 268 exposure_set = extended_attribute_value_as_list(interface, 'Exposed') | 268 exposure_set = extended_attribute_value_as_list(interface, 'Exposed') |
| 269 return sorted(set(exposure_set)) | 269 return sorted(set(exposure_set)) |
| 270 | 270 |
| 271 | 271 |
| 272 # [GarbageCollected], [WillBeGarbageCollected] | |
| 273 def gc_type(definition): | |
| 274 extended_attributes = definition.extended_attributes | |
| 275 if 'GarbageCollected' in extended_attributes: | |
| 276 return 'GarbageCollectedObject' | |
| 277 elif 'WillBeGarbageCollected' in extended_attributes: | |
| 278 return 'WillBeGarbageCollectedObject' | |
| 279 return 'RefCountedObject' | |
| 280 | |
| 281 | |
| 282 # [ImplementedAs] | 272 # [ImplementedAs] |
| 283 def cpp_name(definition_or_member): | 273 def cpp_name(definition_or_member): |
| 284 extended_attributes = definition_or_member.extended_attributes | 274 extended_attributes = definition_or_member.extended_attributes |
| 285 if 'ImplementedAs' not in extended_attributes: | 275 if 'ImplementedAs' not in extended_attributes: |
| 286 return definition_or_member.name | 276 return definition_or_member.name |
| 287 return extended_attributes['ImplementedAs'] | 277 return extended_attributes['ImplementedAs'] |
| 288 | 278 |
| 289 | 279 |
| 290 # [MeasureAs] | 280 # [MeasureAs] |
| 291 def measure_as(definition_or_member): | 281 def measure_as(definition_or_member): |
| (...skipping 10 matching lines...) Expand all Loading... |
| 302 | 292 |
| 303 The returned function checks if a method/attribute is enabled. | 293 The returned function checks if a method/attribute is enabled. |
| 304 Given extended attribute RuntimeEnabled=FeatureName, return: | 294 Given extended attribute RuntimeEnabled=FeatureName, return: |
| 305 RuntimeEnabledFeatures::{featureName}Enabled | 295 RuntimeEnabledFeatures::{featureName}Enabled |
| 306 """ | 296 """ |
| 307 extended_attributes = definition_or_member.extended_attributes | 297 extended_attributes = definition_or_member.extended_attributes |
| 308 if 'RuntimeEnabled' not in extended_attributes: | 298 if 'RuntimeEnabled' not in extended_attributes: |
| 309 return None | 299 return None |
| 310 feature_name = extended_attributes['RuntimeEnabled'] | 300 feature_name = extended_attributes['RuntimeEnabled'] |
| 311 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) | 301 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) |
| OLD | NEW |