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

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

Issue 330293002: Removing unnecessary PerWorldBindings for DOM API calls that are monitored by Activity Logger. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: style Created 6 years, 6 months 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
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 log_activity = extended_attributes['LogActivity'] 139 log_activity = extended_attributes['LogActivity']
140 if log_activity and not log_activity.startswith(access_type): 140 if log_activity and not log_activity.startswith(access_type):
141 return set() 141 return set()
142 142
143 includes.add('bindings/v8/V8DOMActivityLogger.h') 143 includes.add('bindings/v8/V8DOMActivityLogger.h')
144 if 'LogAllWorlds' in extended_attributes: 144 if 'LogAllWorlds' in extended_attributes:
145 return set(['', 'ForMainWorld']) 145 return set(['', 'ForMainWorld'])
146 return set(['']) # At minimum, include isolated worlds. 146 return set(['']) # At minimum, include isolated worlds.
147 147
148 148
149 # [ActivityLogging]
150 def activity_logging_world_check(member):
151 """Returns if an isolated world check is required when generating activity
152 logging code.
153
154 The check is required when there is no per-world binding code and logging is
155 required only for isolated world.
156 """
157 extended_attributes = member.extended_attributes
158 if 'LogActivity' not in extended_attributes:
159 return False
160 if ('PerWorldBindings' not in extended_attributes and
161 'LogAllWorlds' not in extended_attributes):
162 return True
163 return False
164
165
149 # [CallWith] 166 # [CallWith]
150 CALL_WITH_ARGUMENTS = { 167 CALL_WITH_ARGUMENTS = {
151 'ScriptState': 'scriptState', 168 'ScriptState': 'scriptState',
152 'ExecutionContext': 'scriptContext', 169 'ExecutionContext': 'scriptContext',
153 'ScriptArguments': 'scriptArguments.release()', 170 'ScriptArguments': 'scriptArguments.release()',
154 'ActiveWindow': 'callingDOMWindow(info.GetIsolate())', 171 'ActiveWindow': 'callingDOMWindow(info.GetIsolate())',
155 'FirstWindow': 'enteredDOMWindow(info.GetIsolate())', 172 'FirstWindow': 'enteredDOMWindow(info.GetIsolate())',
156 } 173 }
157 # List because key order matters, as we want arguments in deterministic order 174 # List because key order matters, as we want arguments in deterministic order
158 CALL_WITH_VALUES = [ 175 CALL_WITH_VALUES = [
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 256
240 The returned function checks if a method/attribute is enabled. 257 The returned function checks if a method/attribute is enabled.
241 Given extended attribute RuntimeEnabled=FeatureName, return: 258 Given extended attribute RuntimeEnabled=FeatureName, return:
242 RuntimeEnabledFeatures::{featureName}Enabled 259 RuntimeEnabledFeatures::{featureName}Enabled
243 """ 260 """
244 extended_attributes = definition_or_member.extended_attributes 261 extended_attributes = definition_or_member.extended_attributes
245 if 'RuntimeEnabled' not in extended_attributes: 262 if 'RuntimeEnabled' not in extended_attributes:
246 return None 263 return None
247 feature_name = extended_attributes['RuntimeEnabled'] 264 feature_name = extended_attributes['RuntimeEnabled']
248 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) 265 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698