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

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

Issue 27638002: IDL compiler: Basic setters (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix ; Created 7 years, 2 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/unstable/v8_utilities.py ('k') | Source/bindings/templates/interface.h » ('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 e0c72c1e75137cc64d62452be093606bb319ef6e..62c672adc346b530a68323ffb2b2d2df811b2190 100644
--- a/Source/bindings/templates/attributes.cpp
+++ b/Source/bindings/templates/attributes.cpp
@@ -64,10 +64,10 @@ static void {{attribute.name}}AttributeGetter{{world_suffix}}(v8::Local<v8::Stri
v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
if (!wrapper.IsEmpty()) {
V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "{{attribute.name}}", wrapper);
- {{attribute.return_v8_value_statement}}
+ {{attribute.v8_set_return_value}};
}
{% else %}
- {{attribute.return_v8_value_statement}}
+ {{attribute.v8_set_return_value}};
{% endif %}
}
{% endfilter %}
@@ -91,7 +91,7 @@ static void {{attribute.name}}AttributeGetterCallback{{world_suffix}}(v8::Local<
if (contextData && contextData->activityLogger())
contextData->activityLogger()->log("{{interface_name}}.{{attribute.name}}", 0, 0, "Getter");
{% endif %}
- {% if attribute.is_custom_getter %}
+ {% if attribute.has_custom_getter %}
{{v8_class_name}}::{{attribute.name}}AttributeGetterCustom(name, info);
{% else %}
{{cpp_class_name}}V8Internal::{{attribute.name}}AttributeGetter{{world_suffix}}(name, info);
@@ -100,3 +100,25 @@ static void {{attribute.name}}AttributeGetterCallback{{world_suffix}}(v8::Local<
}
{% endfilter %}
{% endmacro %}
+
+
+{##############################################################################}
+{% macro attribute_setter(attribute, world_suffix) %}
+static void {{attribute.name}}AttributeSetter{{world_suffix}}(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
+{
+ {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder());
+ {{attribute.v8_value_to_local_cpp_value}};
+ {{attribute.cpp_setter}};
+}
+{% endmacro %}
+
+
+{##############################################################################}
+{% macro attribute_setter_callback(attribute, world_suffix) %}
+static void {{attribute.name}}AttributeSetterCallback{{world_suffix}}(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
+ {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(name, value, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+{% endmacro %}
« no previous file with comments | « Source/bindings/scripts/unstable/v8_utilities.py ('k') | Source/bindings/templates/interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698