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

Unified Diff: Source/bindings/templates/interface.cpp

Issue 1109323002: [bindings] Support passing of ScriptState for namedPropertyQuery form of getter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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
Index: Source/bindings/templates/interface.cpp
diff --git a/Source/bindings/templates/interface.cpp b/Source/bindings/templates/interface.cpp
index 415d5b64ff30fecbd85a8bc199f21a2d6e3c8394..5e6be27116c96ab5ac67c00c00b1d117962fdce0 100644
--- a/Source/bindings/templates/interface.cpp
+++ b/Source/bindings/templates/interface.cpp
@@ -304,13 +304,21 @@ static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::
not named_property_getter.is_custom_property_query %}
{# If there is an enumerator, there MUST be a query method to properly
communicate property attributes. #}
+{% set getter = named_property_getter %}
static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
{
{{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
AtomicString propertyName = toCoreAtomicString(name.As<v8::String>());
v8::String::Utf8Value namedProperty(name);
ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "{{interface_name}}", info.Holder(), info.GetIsolate());
- bool result = impl->namedPropertyQuery(propertyName, exceptionState);
+ {% if getter.is_call_with_script_state %}
+ ScriptState* scriptState = ScriptState::current(info.GetIsolate());
+ {% endif %}
+ {% set getter_arguments = ['propertyName', 'exceptionState'] %}
+ {% if getter.is_call_with_script_state %}
+ {% set getter_arguments = ['scriptState'] + getter_arguments %}
+ {% endif %}
haraken 2015/04/29 15:53:45 {% set getter_arguments = ['propertyName', 'except
+ bool result = impl->namedPropertyQuery({{getter_arguments | join(', ')}});
if (exceptionState.throwIfNeeded())
return;
if (!result)

Powered by Google App Engine
This is Rietveld 408576698