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

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: ScriptState changes 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
« no previous file with comments | « no previous file | Source/bindings/tests/results/core/V8TestObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/interface.cpp
diff --git a/Source/bindings/templates/interface.cpp b/Source/bindings/templates/interface.cpp
index 415d5b64ff30fecbd85a8bc199f21a2d6e3c8394..03aa6229096e7a84fb70c2fca8d6166114e18551 100644
--- a/Source/bindings/templates/interface.cpp
+++ b/Source/bindings/templates/interface.cpp
@@ -302,6 +302,7 @@ static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::
{% block named_property_query %}
{% if named_property_getter and named_property_getter.is_enumerable and
not named_property_getter.is_custom_property_query %}
+{% set getter = named_property_getter %}
{# If there is an enumerator, there MUST be a query method to properly
communicate property attributes. #}
static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
@@ -310,7 +311,12 @@ static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb
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);
+ {% set getter_arguments = ['propertyName', 'exceptionState'] %}
+ {% if getter.is_call_with_script_state %}
+ ScriptState* scriptState = ScriptState::current(info.GetIsolate());
+ {% set getter_arguments = ['scriptState'] + getter_arguments %}
+ {% endif %}
+ bool result = impl->namedPropertyQuery({{getter_arguments | join(', ')}});
if (exceptionState.throwIfNeeded())
return;
if (!result)
« no previous file with comments | « no previous file | Source/bindings/tests/results/core/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698