Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: Source/bindings/scripts/unstable/v8_utilities.py

Issue 59143004: IDL compiler: Rename [ActivityLogging=Access*] => [ActivityLogging=*] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 # [ActivityLogging] 108 # [ActivityLogging]
109 def activity_logging_world_list(member, access_type=None): 109 def activity_logging_world_list(member, access_type=None):
110 """Returns a set of world suffixes for which a definition member has activit y logging, for specified access type. 110 """Returns a set of world suffixes for which a definition member has activit y logging, for specified access type.
111 111
112 access_type can be 'Getter' or 'Setter' if only checking getting or setting. 112 access_type can be 'Getter' or 'Setter' if only checking getting or setting.
113 """ 113 """
114 if 'ActivityLogging' not in member.extended_attributes: 114 if 'ActivityLogging' not in member.extended_attributes:
115 return set() 115 return set()
116 activity_logging = member.extended_attributes['ActivityLogging'] 116 activity_logging = member.extended_attributes['ActivityLogging']
117 # [ActivityLogging=Access*] means log for all access, otherwise check that 117 # [ActivityLogging=For*] (no prefix, starts with the worlds suffix) means
118 # value agrees with specified access_type. 118 # "log for all use (method)/access (attribute)", otherwise check that value
119 has_logging = (activity_logging.startswith('Access') or 119 # agrees with specified access_type (Getter/Setter).
120 has_logging = (activity_logging.startswith('For') or
120 (access_type and activity_logging.startswith(access_type))) 121 (access_type and activity_logging.startswith(access_type)))
121 if not has_logging: 122 if not has_logging:
122 return set() 123 return set()
123 includes.add('bindings/v8/V8DOMActivityLogger.h') 124 includes.add('bindings/v8/V8DOMActivityLogger.h')
124 if activity_logging.endswith('ForIsolatedWorlds'): 125 if activity_logging.endswith('ForIsolatedWorlds'):
125 return set(['']) 126 return set([''])
126 if activity_logging.endswith('ForAllWorlds'): 127 return set(['', 'ForMainWorld']) # endswith('ForAllWorlds')
127 return set(['', 'ForMainWorld'])
128 raise 'Unrecognized [ActivityLogging] value: "%s"' % activity_logging
Nils Barth (inactive) 2013/11/05 10:56:13 This check and exception are unneeded, b/c already
129 128
130 129
131 # [CallWith] 130 # [CallWith]
132 CALL_WITH_ARGUMENTS = { 131 CALL_WITH_ARGUMENTS = {
133 'ScriptState': '&state', 132 'ScriptState': '&state',
134 'ExecutionContext': 'scriptContext', 133 'ExecutionContext': 'scriptContext',
135 'ScriptArguments': 'scriptArguments.release()', 134 'ScriptArguments': 'scriptArguments.release()',
136 'ActiveWindow': 'activeDOMWindow()', 135 'ActiveWindow': 'activeDOMWindow()',
137 'FirstWindow': 'firstDOMWindow()', 136 'FirstWindow': 'firstDOMWindow()',
138 } 137 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 def cpp_name(definition_or_member): 205 def cpp_name(definition_or_member):
207 return definition_or_member.extended_attributes.get('ImplementedAs', definit ion_or_member.name) 206 return definition_or_member.extended_attributes.get('ImplementedAs', definit ion_or_member.name)
208 207
209 208
210 # [MeasureAs] 209 # [MeasureAs]
211 def generate_measure_as(definition_or_member, contents): 210 def generate_measure_as(definition_or_member, contents):
212 if 'MeasureAs' not in definition_or_member.extended_attributes: 211 if 'MeasureAs' not in definition_or_member.extended_attributes:
213 return 212 return
214 contents['measure_as'] = definition_or_member.extended_attributes['MeasureAs '] 213 contents['measure_as'] = definition_or_member.extended_attributes['MeasureAs ']
215 includes.add('core/page/UseCounter.h') 214 includes.add('core/page/UseCounter.h')
OLDNEW
« no previous file with comments | « Source/bindings/scripts/unstable/v8_methods.py ('k') | Source/bindings/tests/idls/TestActiveDOMObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698