| OLD | NEW |
| 1 {##############################################################################} | 1 {##############################################################################} |
| 2 {% macro attribute_getter(attribute) %} | 2 {% macro attribute_getter(attribute) %} |
| 3 static void {{attribute.name}}AttributeGetter(v8::Local<v8::String> name, const
v8::PropertyCallbackInfo<v8::Value>& info) | 3 static void {{attribute.name}}AttributeGetter(v8::Local<v8::String> name, const
v8::PropertyCallbackInfo<v8::Value>& info) |
| 4 { | 4 { |
| 5 {% if not attribute.is_static %} |
| 5 {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder()); | 6 {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder()); |
| 7 {% endif %} |
| 6 {% if attribute.is_keep_alive_for_gc %} | 8 {% if attribute.is_keep_alive_for_gc %} |
| 7 {{attribute.cpp_type}} result = imp->{{attribute.cpp_method_name}}(); | 9 {{attribute.cpp_type}} result = {{attribute.cpp_value}}; |
| 8 if (result.get() && DOMDataStore::setReturnValueFromWrapper<{{attribute.v8_t
ype}}>(info.GetReturnValue(), result.get())) | 10 if (result.get() && DOMDataStore::setReturnValueFromWrapper<{{attribute.v8_t
ype}}>(info.GetReturnValue(), result.get())) |
| 9 return; | 11 return; |
| 10 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); | 12 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); |
| 11 if (!wrapper.IsEmpty()) { | 13 if (!wrapper.IsEmpty()) { |
| 12 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "{{attribut
e.name}}", wrapper); | 14 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "{{attribut
e.name}}", wrapper); |
| 13 v8SetReturnValue(info, wrapper); | 15 v8SetReturnValue(info, wrapper); |
| 14 } | 16 } |
| 15 {% else %} | 17 {% else %} |
| 16 {{attribute.return_v8_value_statement | indent}} | 18 {{attribute.return_v8_value_statement}} |
| 17 {% endif %} | 19 {% endif %} |
| 18 return; | 20 return; |
| 19 } | 21 } |
| 20 {% endmacro %} | 22 {% endmacro %} |
| 21 | 23 |
| 22 | 24 |
| 23 {##############################################################################} | 25 {##############################################################################} |
| 24 {% macro attribute_getter_callback(attribute) %} | 26 {% macro attribute_getter_callback(attribute) %} |
| 25 static void {{attribute.name}}AttributeGetterCallback(v8::Local<v8::String> name
, const v8::PropertyCallbackInfo<v8::Value>& info) | 27 static void {{attribute.name}}AttributeGetterCallback(v8::Local<v8::String> name
, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 26 { | 28 { |
| 27 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 29 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 28 {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeGetter(name, info); | 30 {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeGetter(name, info); |
| 29 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 31 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 30 } | 32 } |
| 31 {% endmacro %} | 33 {% endmacro %} |
| OLD | NEW |