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

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

Issue 24867002: Add static attributes to IDL compiler (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revised, fix Perl Created 7 years, 3 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/attributes.cpp
diff --git a/Source/bindings/templates/attributes.cpp b/Source/bindings/templates/attributes.cpp
index b9ffc8d095e641ea22e69fb51ee97a9179d64182..38a87395a7547e124bfe2b1891db728a33dd051b 100644
--- a/Source/bindings/templates/attributes.cpp
+++ b/Source/bindings/templates/attributes.cpp
@@ -2,9 +2,11 @@
{% macro attribute_getter(attribute) %}
static void {{attribute.name}}AttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
+ {% if not attribute.is_static %}
{{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder());
+ {% endif %}
{% if attribute.is_keep_alive_for_gc %}
- {{attribute.cpp_type}} result = imp->{{attribute.cpp_method_name}}();
+ {{attribute.cpp_type}} result = {{attribute.cpp_value}};
if (result.get() && DOMDataStore::setReturnValueFromWrapper<{{attribute.v8_type}}>(info.GetReturnValue(), result.get()))
return;
v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
@@ -13,7 +15,7 @@ static void {{attribute.name}}AttributeGetter(v8::Local<v8::String> name, const
v8SetReturnValue(info, wrapper);
}
{% else %}
- {{attribute.return_v8_value_statement | indent}}
+ {{attribute.return_v8_value_statement}}
{% endif %}
return;
}

Powered by Google App Engine
This is Rietveld 408576698