| 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 return None | 241 return None |
| 242 includes.add('core/frame/UseCounter.h') | 242 includes.add('core/frame/UseCounter.h') |
| 243 return extended_attributes['DeprecateAs'] | 243 return extended_attributes['DeprecateAs'] |
| 244 | 244 |
| 245 | 245 |
| 246 # [Exposed] | 246 # [Exposed] |
| 247 EXPOSED_EXECUTION_CONTEXT_METHOD = { | 247 EXPOSED_EXECUTION_CONTEXT_METHOD = { |
| 248 'DedicatedWorker': 'isDedicatedWorkerGlobalScope', | 248 'DedicatedWorker': 'isDedicatedWorkerGlobalScope', |
| 249 'ServiceWorker': 'isServiceWorkerGlobalScope', | 249 'ServiceWorker': 'isServiceWorkerGlobalScope', |
| 250 'SharedWorker': 'isSharedWorkerGlobalScope', | 250 'SharedWorker': 'isSharedWorkerGlobalScope', |
| 251 'UIWorker': 'isUIWorkerGlobalScope', |
| 251 'Window': 'isDocument', | 252 'Window': 'isDocument', |
| 252 'Worker': 'isWorkerGlobalScope', | 253 'Worker': 'isWorkerGlobalScope', |
| 253 } | 254 } |
| 254 | 255 |
| 255 | 256 |
| 256 def exposed(definition_or_member, interface): | 257 def exposed(definition_or_member, interface): |
| 257 exposure_set = extended_attribute_value_as_list(definition_or_member, 'Expos
ed') | 258 exposure_set = extended_attribute_value_as_list(definition_or_member, 'Expos
ed') |
| 258 if not exposure_set: | 259 if not exposure_set: |
| 259 return None | 260 return None |
| 260 | 261 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 273 exposure_checks.append('context->%s()' % EXPOSED_EXECUTION_CONTEXT_METHO
D[environment]) | 274 exposure_checks.append('context->%s()' % EXPOSED_EXECUTION_CONTEXT_METHO
D[environment]) |
| 274 | 275 |
| 275 return ' || '.join(exposure_checks) | 276 return ' || '.join(exposure_checks) |
| 276 | 277 |
| 277 | 278 |
| 278 def expanded_exposure_set_for_interface(interface): | 279 def expanded_exposure_set_for_interface(interface): |
| 279 exposure_set = extended_attribute_value_as_list(interface, 'Exposed') | 280 exposure_set = extended_attribute_value_as_list(interface, 'Exposed') |
| 280 | 281 |
| 281 # "Worker" is an aggregation for the different kinds of workers. | 282 # "Worker" is an aggregation for the different kinds of workers. |
| 282 if 'Worker' in exposure_set: | 283 if 'Worker' in exposure_set: |
| 283 exposure_set.extend(('DedicatedWorker', 'SharedWorker', 'ServiceWorker')
) | 284 exposure_set.extend(('DedicatedWorker', 'SharedWorker', 'ServiceWorker',
'UIWorker')) |
| 284 | 285 |
| 285 return sorted(set(exposure_set)) | 286 return sorted(set(exposure_set)) |
| 286 | 287 |
| 287 | 288 |
| 288 # [GarbageCollected], [WillBeGarbageCollected] | 289 # [GarbageCollected], [WillBeGarbageCollected] |
| 289 def gc_type(definition): | 290 def gc_type(definition): |
| 290 extended_attributes = definition.extended_attributes | 291 extended_attributes = definition.extended_attributes |
| 291 if 'GarbageCollected' in extended_attributes: | 292 if 'GarbageCollected' in extended_attributes: |
| 292 return 'GarbageCollectedObject' | 293 return 'GarbageCollectedObject' |
| 293 elif 'WillBeGarbageCollected' in extended_attributes: | 294 elif 'WillBeGarbageCollected' in extended_attributes: |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 | 335 |
| 335 The returned function checks if a method/attribute is enabled. | 336 The returned function checks if a method/attribute is enabled. |
| 336 Given extended attribute RuntimeEnabled=FeatureName, return: | 337 Given extended attribute RuntimeEnabled=FeatureName, return: |
| 337 RuntimeEnabledFeatures::{featureName}Enabled | 338 RuntimeEnabledFeatures::{featureName}Enabled |
| 338 """ | 339 """ |
| 339 extended_attributes = definition_or_member.extended_attributes | 340 extended_attributes = definition_or_member.extended_attributes |
| 340 if 'RuntimeEnabled' not in extended_attributes: | 341 if 'RuntimeEnabled' not in extended_attributes: |
| 341 return None | 342 return None |
| 342 feature_name = extended_attributes['RuntimeEnabled'] | 343 feature_name = extended_attributes['RuntimeEnabled'] |
| 343 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) | 344 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) |
| OLD | NEW |