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

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

Issue 413393003: Blink-in-JS: Implement internal APIs exposed only to private scripts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/scripts/v8_attributes.py ('k') | Source/bindings/scripts/v8_methods.py » ('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 # coding=utf-8 2 # coding=utf-8
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 'constants': [constant_context(constant) 225 'constants': [constant_context(constant)
226 for constant in interface.constants], 226 for constant in interface.constants],
227 'do_not_check_constants': 'DoNotCheckConstants' in extended_attributes, 227 'do_not_check_constants': 'DoNotCheckConstants' in extended_attributes,
228 }) 228 })
229 229
230 # Attributes 230 # Attributes
231 attributes = [v8_attributes.attribute_context(interface, attribute) 231 attributes = [v8_attributes.attribute_context(interface, attribute)
232 for attribute in interface.attributes] 232 for attribute in interface.attributes]
233 context.update({ 233 context.update({
234 'attributes': attributes, 234 'attributes': attributes,
235 'has_accessors': any(attribute['is_expose_js_accessors'] for attribute i n attributes), 235 'has_accessors': any(attribute['is_expose_js_accessors'] and attribute[' should_be_exposed_to_script'] for attribute in attributes),
236 'has_attribute_configuration': any( 236 'has_attribute_configuration': any(
237 not (attribute['is_expose_js_accessors'] or 237 not (attribute['is_expose_js_accessors'] or
238 attribute['is_static'] or 238 attribute['is_static'] or
239 attribute['runtime_enabled_function'] or 239 attribute['runtime_enabled_function'] or
240 attribute['per_context_enabled_function']) 240 attribute['per_context_enabled_function'])
241 and attribute['should_be_exposed_to_script']
241 for attribute in attributes), 242 for attribute in attributes),
242 'has_constructor_attributes': any(attribute['constructor_type'] for attr ibute in attributes), 243 'has_constructor_attributes': any(attribute['constructor_type'] for attr ibute in attributes),
243 'has_per_context_enabled_attributes': any(attribute['per_context_enabled _function'] for attribute in attributes), 244 'has_per_context_enabled_attributes': any(attribute['per_context_enabled _function'] for attribute in attributes),
244 'has_replaceable_attributes': any(attribute['is_replaceable'] for attrib ute in attributes), 245 'has_replaceable_attributes': any(attribute['is_replaceable'] for attrib ute in attributes),
245 }) 246 })
246 247
247 # Methods 248 # Methods
248 methods = [v8_methods.method_context(interface, method) 249 methods = [v8_methods.method_context(interface, method)
249 for method in interface.operations 250 for method in interface.operations
250 if method.name] # Skip anonymous special operations (methods) 251 if method.name] # Skip anonymous special operations (methods)
(...skipping 30 matching lines...) Expand all
281 per_context_enabled_function = method['per_context_enabled_function' ] 282 per_context_enabled_function = method['per_context_enabled_function' ]
282 runtime_enabled_function = method['runtime_enabled_function'] 283 runtime_enabled_function = method['runtime_enabled_function']
283 has_custom_registration = method['has_custom_registration'] 284 has_custom_registration = method['has_custom_registration']
284 285
285 if per_context_enabled_function: 286 if per_context_enabled_function:
286 per_context_enabled_methods.append(method) 287 per_context_enabled_methods.append(method)
287 continue 288 continue
288 if runtime_enabled_function or has_custom_registration: 289 if runtime_enabled_function or has_custom_registration:
289 custom_registration_methods.append(method) 290 custom_registration_methods.append(method)
290 continue 291 continue
291 method_configuration_methods.append(method) 292 if method['should_be_exposed_to_script']:
293 method_configuration_methods.append(method)
292 294
293 for method in methods: 295 for method in methods:
294 # The value of the Function object’s “length” property is a Number 296 # The value of the Function object’s “length” property is a Number
295 # determined as follows: 297 # determined as follows:
296 # 1. Let S be the effective overload set for regular operations (if the 298 # 1. Let S be the effective overload set for regular operations (if the
297 # operation is a regular operation) or for static operations (if the 299 # operation is a regular operation) or for static operations (if the
298 # operation is a static operation) with identifier id on interface I and 300 # operation is a static operation) with identifier id on interface I and
299 # with argument count 0. 301 # with argument count 0.
300 # 2. Return the length of the shortest argument list of the entries in S . 302 # 2. Return the length of the shortest argument list of the entries in S .
301 # FIXME: This calculation doesn't take into account whether runtime 303 # FIXME: This calculation doesn't take into account whether runtime
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 deleter = next( 1102 deleter = next(
1101 method 1103 method
1102 for method in interface.operations 1104 for method in interface.operations
1103 if ('deleter' in method.specials and 1105 if ('deleter' in method.specials and
1104 len(method.arguments) == 1 and 1106 len(method.arguments) == 1 and
1105 str(method.arguments[0].idl_type) == 'DOMString')) 1107 str(method.arguments[0].idl_type) == 'DOMString'))
1106 except StopIteration: 1108 except StopIteration:
1107 return None 1109 return None
1108 1110
1109 return property_deleter(deleter) 1111 return property_deleter(deleter)
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_attributes.py ('k') | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698