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

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: rebase 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
« no previous file with comments | « Source/bindings/scripts/v8_attributes.py ('k') | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 log_activity = extended_attributes['LogActivity'] 148 log_activity = extended_attributes['LogActivity']
149 if log_activity and not log_activity.startswith(access_type): 149 if log_activity and not log_activity.startswith(access_type):
150 return set() 150 return set()
151 151
152 includes.add('bindings/v8/V8DOMActivityLogger.h') 152 includes.add('bindings/v8/V8DOMActivityLogger.h')
153 if 'LogAllWorlds' in extended_attributes: 153 if 'LogAllWorlds' in extended_attributes:
154 return set(['', 'ForMainWorld']) 154 return set(['', 'ForMainWorld'])
155 return set(['']) # At minimum, include isolated worlds. 155 return set(['']) # At minimum, include isolated worlds.
156 156
157 157
158 # [ActivityLogging]
159 def activity_logging_world_check(member):
160 """Returns if an isolated world check is required when generating activity
161 logging code.
162
163 The check is required when there is no per-world binding code and logging is
164 required only for isolated world.
165 """
166 extended_attributes = member.extended_attributes
167 if 'LogActivity' not in extended_attributes:
168 return False
169 if ('PerWorldBindings' not in extended_attributes and
170 'LogAllWorlds' not in extended_attributes):
171 return True
172 return False
173
174
158 # [CallWith] 175 # [CallWith]
159 CALL_WITH_ARGUMENTS = { 176 CALL_WITH_ARGUMENTS = {
160 'ScriptState': 'scriptState', 177 'ScriptState': 'scriptState',
161 'ExecutionContext': 'scriptContext', 178 'ExecutionContext': 'scriptContext',
162 'ScriptArguments': 'scriptArguments.release()', 179 'ScriptArguments': 'scriptArguments.release()',
163 'ActiveWindow': 'callingDOMWindow(info.GetIsolate())', 180 'ActiveWindow': 'callingDOMWindow(info.GetIsolate())',
164 'FirstWindow': 'enteredDOMWindow(info.GetIsolate())', 181 'FirstWindow': 'enteredDOMWindow(info.GetIsolate())',
165 } 182 }
166 # List because key order matters, as we want arguments in deterministic order 183 # List because key order matters, as we want arguments in deterministic order
167 CALL_WITH_VALUES = [ 184 CALL_WITH_VALUES = [
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 265
249 The returned function checks if a method/attribute is enabled. 266 The returned function checks if a method/attribute is enabled.
250 Given extended attribute RuntimeEnabled=FeatureName, return: 267 Given extended attribute RuntimeEnabled=FeatureName, return:
251 RuntimeEnabledFeatures::{featureName}Enabled 268 RuntimeEnabledFeatures::{featureName}Enabled
252 """ 269 """
253 extended_attributes = definition_or_member.extended_attributes 270 extended_attributes = definition_or_member.extended_attributes
254 if 'RuntimeEnabled' not in extended_attributes: 271 if 'RuntimeEnabled' not in extended_attributes:
255 return None 272 return None
256 feature_name = extended_attributes['RuntimeEnabled'] 273 feature_name = extended_attributes['RuntimeEnabled']
257 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) 274 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name)
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_attributes.py ('k') | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698