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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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=None): |
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 if 'LogActivity' not in member.extended_attributes: |
Nils Barth (inactive)
2014/04/23 03:04:42
BTW, could you add
extended_attributes = member.ex
Devlin
2014/04/23 18:28:02
Done (in other cl).
| |
137 return set() | 137 return set() |
138 activity_logging = member.extended_attributes['ActivityLogging'] | 138 log_activity = member.extended_attributes['LogActivity'] |
139 # [ActivityLogging=For*] (no prefix, starts with the worlds suffix) means | 139 if (log_activity == 'GetterOnly' and access_type != 'Getter') or (log_activi ty == 'SetterOnly' and access_type != 'Setter'): |
Nils Barth (inactive)
2014/04/23 03:04:42
This could be:
if log_activity and not log_activit
Devlin
2014/04/23 18:28:02
Done (in other cl). My inclination is to keep Get
Nils Barth (inactive)
2014/04/24 01:00:41
That's fine, and agreed that explicit is better he
| |
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() | 140 return set() |
141 | |
146 includes.add('bindings/v8/V8DOMActivityLogger.h') | 142 includes.add('bindings/v8/V8DOMActivityLogger.h') |
147 if activity_logging.endswith('ForIsolatedWorlds'): | 143 # At minimum, include isolated worlds. |
148 return set(['']) | 144 world_list = [''] |
149 return set(['', 'ForMainWorld']) # endswith('ForAllWorlds') | 145 if 'LogAllWorlds' in member.extended_attributes: |
146 world_list.append('ForMainWorld') | |
147 return world_list | |
Nils Barth (inactive)
2014/04/23 03:04:42
return set(world_list)
I'd tend to prefer avoiding
Devlin
2014/04/23 18:28:02
Done (in other cl).
| |
150 | 148 |
151 | 149 |
152 # [CallWith] | 150 # [CallWith] |
153 CALL_WITH_ARGUMENTS = { | 151 CALL_WITH_ARGUMENTS = { |
154 'ScriptState': 'state', | 152 'ScriptState': 'state', |
155 'NewScriptState': 'state', | 153 'NewScriptState': 'state', |
156 'ExecutionContext': 'scriptContext', | 154 'ExecutionContext': 'scriptContext', |
157 'ScriptArguments': 'scriptArguments.release()', | 155 'ScriptArguments': 'scriptArguments.release()', |
158 'ActiveWindow': 'callingDOMWindow(info.GetIsolate())', | 156 'ActiveWindow': 'callingDOMWindow(info.GetIsolate())', |
159 'FirstWindow': 'enteredDOMWindow(info.GetIsolate())', | 157 'FirstWindow': 'enteredDOMWindow(info.GetIsolate())', |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
244 | 242 |
245 The returned function checks if a method/attribute is enabled. | 243 The returned function checks if a method/attribute is enabled. |
246 Given extended attribute RuntimeEnabled=FeatureName, return: | 244 Given extended attribute RuntimeEnabled=FeatureName, return: |
247 RuntimeEnabledFeatures::{featureName}Enabled | 245 RuntimeEnabledFeatures::{featureName}Enabled |
248 """ | 246 """ |
249 extended_attributes = definition_or_member.extended_attributes | 247 extended_attributes = definition_or_member.extended_attributes |
250 if 'RuntimeEnabled' not in extended_attributes: | 248 if 'RuntimeEnabled' not in extended_attributes: |
251 return None | 249 return None |
252 feature_name = extended_attributes['RuntimeEnabled'] | 250 feature_name = extended_attributes['RuntimeEnabled'] |
253 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) | 251 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) |
OLD | NEW |