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

Unified Diff: Source/bindings/scripts/unstable/v8_methods.py

Issue 64763004: IDL compiler: [Unforgeable] methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/bindings/tests/idls/TestObjectPython.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/unstable/v8_methods.py
diff --git a/Source/bindings/scripts/unstable/v8_methods.py b/Source/bindings/scripts/unstable/v8_methods.py
index 39d35c4d1eec0b766ac21dd591f23b2f829b281d..a71e9bb7c60f9db9b7de3abfc6184e4cfe134daa 100644
--- a/Source/bindings/scripts/unstable/v8_methods.py
+++ b/Source/bindings/scripts/unstable/v8_methods.py
@@ -50,12 +50,24 @@ def generate_method(interface, method):
this_cpp_value = cpp_value(interface, method, len(arguments))
this_custom_signature = custom_signature(method, arguments)
- if this_custom_signature:
- signature = name + 'Signature'
- elif is_static or 'DoNotCheckSignature' in extended_attributes:
- signature = 'v8::Local<v8::Signature>()'
- else:
- signature = 'defaultSignature'
+
+ def function_template():
+ # FIXME: Rename as follows (also in v8/V8DOMConfiguration):
+ # desc => functionTemplate
+ # instance => instanceTemplate
+ # proto => prototypeTemplate
+ if is_static:
+ return 'desc'
+ if 'Unforgeable' in extended_attributes:
+ return 'instance'
+ return 'proto'
+
+ def signature():
+ if this_custom_signature:
+ return name + 'Signature'
+ if is_static or 'DoNotCheckSignature' in extended_attributes:
+ return 'v8::Local<v8::Signature>()'
+ return 'defaultSignature'
is_call_with_script_arguments = has_extended_attribute_value(method, 'CallWith', 'ScriptArguments')
if is_call_with_script_arguments:
@@ -86,8 +98,9 @@ def generate_method(interface, method):
'deprecate_as': v8_utilities.deprecate_as(method), # [DeprecateAs]
'do_not_check_signature': not(this_custom_signature or is_static or
v8_utilities.has_extended_attribute(method,
- ['DoNotCheckSignature', 'NotEnumerable', 'ReadOnly'])),
- 'function_template': 'desc' if method.is_static else 'proto',
+ ['DoNotCheckSignature', 'NotEnumerable', 'ReadOnly',
+ 'Unforgeable'])),
+ 'function_template': function_template(),
'idl_type': idl_type,
'is_call_with_execution_context': has_extended_attribute_value(method, 'CallWith', 'ExecutionContext'),
'is_call_with_script_arguments': is_call_with_script_arguments,
@@ -109,7 +122,7 @@ def generate_method(interface, method):
if not argument.is_optional]),
'per_context_enabled_function_name': v8_utilities.per_context_enabled_function_name(method), # [PerContextEnabled]
'property_attributes': property_attributes(method),
- 'signature': signature,
+ 'signature': signature(),
'v8_set_return_value': v8_set_return_value(method, this_cpp_value),
'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended_attributes else [''], # [PerWorldBindings]
}
« no previous file with comments | « no previous file | Source/bindings/tests/idls/TestObjectPython.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698