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

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

Issue 946973005: IDL: Drop value conversion (V8 -> C++) macros from generated code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comments 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 | « Source/bindings/scripts/v8_union.py ('k') | Source/bindings/templates/conversions.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/attributes.cpp
diff --git a/Source/bindings/templates/attributes.cpp b/Source/bindings/templates/attributes.cpp
index f7bc807acd6fcd53e79afed39c967926936fb1f9..7b1a84db784dc1e0f003ee70abef2a3dd2b0fbaa 100644
--- a/Source/bindings/templates/attributes.cpp
+++ b/Source/bindings/templates/attributes.cpp
@@ -1,3 +1,6 @@
+{% from 'conversions.cpp' import v8_value_to_local_cpp_value %}
+
+
{##############################################################################}
{% macro attribute_getter(attribute, world_suffix) %}
{% filter conditional(attribute.conditional_string) %}
@@ -217,9 +220,6 @@ v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info
{% if attribute.has_setter_exception_state %}
ExceptionState exceptionState(ExceptionState::SetterContext, "{{attribute.name}}", "{{interface_name}}", holder, info.GetIsolate());
{% endif %}
- {% if attribute.use_output_parameter_for_result %}
- {{attribute.cpp_type}} cppValue;
- {% endif %}
{# impl #}
{% if attribute.put_forwards %}
{{cpp_class}}* proxyImpl = {{v8_class}}::toImpl(holder);
@@ -235,7 +235,7 @@ v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info
{% endif %}
{# Convert JS value to C++ value #}
{% if attribute.idl_type != 'EventHandler' %}
- {{attribute.v8_value_to_local_cpp_value}};
+ {{v8_value_to_local_cpp_value(attribute) | indent}}
{% elif not is_node %}{# EventHandler hack #}
moveEventListenerToNewWrapper(info.GetIsolate(), holder, {{attribute.event_handler_getter_expression}}, v8Value, {{v8_class}}::eventListenerCacheIndex);
{% endif %}
@@ -349,7 +349,7 @@ bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeGetter(LocalFrame*
v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, scriptStateInUserScript, "{{cpp_class}}", "{{attribute.name}}", holder);
if (v8Value.IsEmpty())
return false;
- {{attribute.private_script_v8_value_to_local_cpp_value}};
+ {{v8_value_to_local_cpp_value(attribute.private_script_v8_value_to_local_cpp_value) | indent}}
RELEASE_ASSERT(!exceptionState.hadException());
*result = cppValue;
return true;
« no previous file with comments | « Source/bindings/scripts/v8_union.py ('k') | Source/bindings/templates/conversions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698