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

Unified Diff: Source/bindings/scripts/v8_interface.py

Issue 968573004: [bindings] Support extended attribute '[CallWith=ScriptState ]' for getter/setter/deleter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@972153002
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/bindings/templates/interface.cpp » ('j') | Source/bindings/templates/interface.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_interface.py
diff --git a/Source/bindings/scripts/v8_interface.py b/Source/bindings/scripts/v8_interface.py
index 249ea0ba9bdb0cf6c41fb8eff6ce4a3a013c7878..cb6984c6790aa1a2b32dcfd8c83803fed02ae18f 100644
--- a/Source/bindings/scripts/v8_interface.py
+++ b/Source/bindings/scripts/v8_interface.py
@@ -1236,11 +1236,16 @@ def property_getter(getter, cpp_arguments):
idl_type = getter.idl_type
extended_attributes = getter.extended_attributes
is_raises_exception = 'RaisesException' in extended_attributes
+ is_call_with_script_state = False
+ if 'CallWith' in extended_attributes and extended_attributes['CallWith'] == 'ScriptState':
+ is_call_with_script_state = True
haraken 2015/03/05 05:56:13 Use v8_utilities.has_extended_attribute_value(attr
use_output_parameter_for_result = idl_type.use_output_parameter_for_result
# FIXME: make more generic, so can use v8_methods.cpp_value
cpp_method_name = 'impl->%s' % cpp_name(getter)
+ if is_call_with_script_state:
+ cpp_arguments.insert(0, 'scriptState')
if is_raises_exception:
cpp_arguments.append('exceptionState')
if use_output_parameter_for_result:
@@ -1263,6 +1268,7 @@ def property_getter(getter, cpp_arguments):
'is_enumerable': 'NotEnumerable' not in extended_attributes,
'is_null_expression': is_null_expression(idl_type),
'is_raises_exception': is_raises_exception,
+ 'is_call_with_script_state': is_call_with_script_state,
'name': cpp_name(getter),
'use_output_parameter_for_result': use_output_parameter_for_result,
'v8_set_return_value': idl_type.v8_set_return_value('result', extended_attributes=extended_attributes, script_wrappable='impl', release=idl_type.release),
@@ -1276,6 +1282,9 @@ def property_setter(setter, interface):
idl_type = setter.arguments[1].idl_type
extended_attributes = setter.extended_attributes
is_raises_exception = 'RaisesException' in extended_attributes
+ is_call_with_script_state = False
+ if 'CallWith' in extended_attributes and extended_attributes['CallWith'] == 'ScriptState':
+ is_call_with_script_state = True
# [TypeChecking=Interface] / [LegacyInterfaceTypeChecking]
has_type_checking_interface = (
@@ -1290,6 +1299,7 @@ def property_setter(setter, interface):
'is_custom': 'Custom' in extended_attributes,
'is_nullable': idl_type.is_nullable,
'is_raises_exception': is_raises_exception,
+ 'is_call_with_script_state': is_call_with_script_state,
'name': cpp_name(setter),
'v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value(
extended_attributes, 'v8Value', 'propertyValue'),
@@ -1302,8 +1312,12 @@ def property_deleter(deleter):
idl_type = deleter.idl_type
extended_attributes = deleter.extended_attributes
+ is_call_with_script_state = False
+ if 'CallWith' in extended_attributes and extended_attributes['CallWith'] == 'ScriptState':
+ is_call_with_script_state = True
return {
'is_custom': 'Custom' in extended_attributes,
'is_raises_exception': 'RaisesException' in extended_attributes,
+ 'is_call_with_script_state': is_call_with_script_state,
'name': cpp_name(deleter),
}
« no previous file with comments | « no previous file | Source/bindings/templates/interface.cpp » ('j') | Source/bindings/templates/interface.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698