| OLD | NEW |
| (Empty) | |
| 1 {% macro attribute_getter(attribute) %} |
| 2 static void {{attribute.name}}AttributeGetter(v8::Local<v8::String> name, const
v8::PropertyCallbackInfo<v8::Value>& info) |
| 3 { |
| 4 {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder()); |
| 5 {% if attribute.should_keep_attribute_alive %} |
| 6 {{attribute.cpp_type}} result = imp->{{attribute.cpp_method_name}}(); |
| 7 if (result.get() && DOMDataStore::setReturnValueFromWrapper<{{attribute.v8_t
ype}}>(info.GetReturnValue(), result.get())) |
| 8 return; |
| 9 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); |
| 10 if (!wrapper.IsEmpty()) { |
| 11 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "{{attribut
e.name}}", wrapper); |
| 12 v8SetReturnValue(info, wrapper); |
| 13 } |
| 14 {% else %} |
| 15 {{attribute.return_v8_value_statement | indent}} |
| 16 {% endif %} |
| 17 return; |
| 18 } |
| 19 {% endmacro %} |
| 20 |
| 21 |
| 22 {##############################################################################} |
| 23 {% macro attribute_getter_callback(attribute) %} |
| 24 static void {{attribute.name}}AttributeGetterCallback(v8::Local<v8::String> name
, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 25 { |
| 26 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 27 {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeGetter(name, info); |
| 28 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 29 } |
| 30 {% endmacro %} |
| 31 |
| 32 |
| 33 {##############################################################################} |
| 34 {% macro class_attributes() %} |
| 35 static const V8DOMConfiguration::AttributeConfiguration {{v8_class_name}}Attribu
tes[] = { |
| 36 {% for attribute in attributes %} |
| 37 {"{{attribute.name}}", {{cpp_class_name}}V8Internal::{{attribute.name}}Attri
buteGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), sta
tic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 38 {% endfor %} |
| 39 }; |
| 40 {% endmacro %} |
| OLD | NEW |