| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 def v8_class_name(interface): | 122 def v8_class_name(interface): |
| 123 return v8_types.v8_type(interface.name) | 123 return v8_types.v8_type(interface.name) |
| 124 | 124 |
| 125 | 125 |
| 126 ################################################################################ | 126 ################################################################################ |
| 127 # Specific extended attributes | 127 # Specific extended attributes |
| 128 ################################################################################ | 128 ################################################################################ |
| 129 | 129 |
| 130 # [ActivityLogging] | 130 # [ActivityLogging] |
| 131 def activity_logging_world_list(member, access_type=None): | 131 def activity_logging_world_list(member, access_type=''): |
| 132 """Returns a set of world suffixes for which a definition member has activit
y logging, for specified access type. | 132 """Returns a set of world suffixes for which a definition member has activit
y logging, for specified access type. |
| 133 | 133 |
| 134 access_type can be 'Getter' or 'Setter' if only checking getting or setting. | 134 access_type can be 'Getter' or 'Setter' if only checking getting or setting. |
| 135 """ | 135 """ |
| 136 if 'ActivityLogging' not in member.extended_attributes: | 136 extended_attributes = member.extended_attributes |
| 137 if 'LogActivity' not in extended_attributes: |
| 137 return set() | 138 return set() |
| 138 activity_logging = member.extended_attributes['ActivityLogging'] | 139 log_activity = extended_attributes['LogActivity'] |
| 139 # [ActivityLogging=For*] (no prefix, starts with the worlds suffix) means | 140 if log_activity and not log_activity.startswith(access_type): |
| 140 # "log for all use (method)/access (attribute)", otherwise check that value | |
| 141 # agrees with specified access_type (Getter/Setter). | |
| 142 has_logging = (activity_logging.startswith('For') or | |
| 143 (access_type and activity_logging.startswith(access_type))) | |
| 144 if not has_logging: | |
| 145 return set() | 141 return set() |
| 142 |
| 146 includes.add('bindings/v8/V8DOMActivityLogger.h') | 143 includes.add('bindings/v8/V8DOMActivityLogger.h') |
| 147 if activity_logging.endswith('ForIsolatedWorlds'): | 144 if 'LogAllWorlds' in extended_attributes: |
| 148 return set(['']) | 145 return set(['', 'ForMainWorld']) |
| 149 return set(['', 'ForMainWorld']) # endswith('ForAllWorlds') | 146 return set(['']) # At minimum, include isolated worlds. |
| 150 | 147 |
| 151 | 148 |
| 152 # [CallWith] | 149 # [CallWith] |
| 153 CALL_WITH_ARGUMENTS = { | 150 CALL_WITH_ARGUMENTS = { |
| 154 'ScriptState': 'state', | 151 'ScriptState': 'state', |
| 155 'NewScriptState': 'state', | 152 'NewScriptState': 'state', |
| 156 'ExecutionContext': 'scriptContext', | 153 'ExecutionContext': 'scriptContext', |
| 157 'ScriptArguments': 'scriptArguments.release()', | 154 'ScriptArguments': 'scriptArguments.release()', |
| 158 'ActiveWindow': 'callingDOMWindow(info.GetIsolate())', | 155 'ActiveWindow': 'callingDOMWindow(info.GetIsolate())', |
| 159 'FirstWindow': 'enteredDOMWindow(info.GetIsolate())', | 156 'FirstWindow': 'enteredDOMWindow(info.GetIsolate())', |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 241 |
| 245 The returned function checks if a method/attribute is enabled. | 242 The returned function checks if a method/attribute is enabled. |
| 246 Given extended attribute RuntimeEnabled=FeatureName, return: | 243 Given extended attribute RuntimeEnabled=FeatureName, return: |
| 247 RuntimeEnabledFeatures::{featureName}Enabled | 244 RuntimeEnabledFeatures::{featureName}Enabled |
| 248 """ | 245 """ |
| 249 extended_attributes = definition_or_member.extended_attributes | 246 extended_attributes = definition_or_member.extended_attributes |
| 250 if 'RuntimeEnabled' not in extended_attributes: | 247 if 'RuntimeEnabled' not in extended_attributes: |
| 251 return None | 248 return None |
| 252 feature_name = extended_attributes['RuntimeEnabled'] | 249 feature_name = extended_attributes['RuntimeEnabled'] |
| 253 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) | 250 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) |
| OLD | NEW |