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