| OLD | NEW |
| 1 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable, v8_value_t
o_local_cpp_value %} | 1 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable, v8_value_t
o_local_cpp_value %} |
| 2 | 2 |
| 3 {##############################################################################} | 3 {##############################################################################} |
| 4 {% macro attribute_getter(attribute, world_suffix) %} | 4 {% macro attribute_getter(attribute, world_suffix) %} |
| 5 static void {{attribute.name}}AttributeGetter{{world_suffix}}( | 5 static void {{attribute.name}}AttributeGetter{{world_suffix}}( |
| 6 {%- if attribute.is_data_type_property %} | 6 {%- if attribute.is_data_type_property %} |
| 7 const v8::PropertyCallbackInfo<v8::Value>& info | 7 const v8::PropertyCallbackInfo<v8::Value>& info |
| 8 {%- else %} | 8 {%- else %} |
| 9 const v8::FunctionCallbackInfo<v8::Value>& info | 9 const v8::FunctionCallbackInfo<v8::Value>& info |
| 10 {%- endif %}) { | 10 {%- endif %}) { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 {% if attribute.is_explicit_nullable %} | 144 {% if attribute.is_explicit_nullable %} |
| 145 if (isNull) { | 145 if (isNull) { |
| 146 V8SetReturnValueNull(info); | 146 V8SetReturnValueNull(info); |
| 147 return; | 147 return; |
| 148 } | 148 } |
| 149 {% endif %} | 149 {% endif %} |
| 150 | 150 |
| 151 {% if attribute.is_keep_alive_for_gc %} | 151 {% if attribute.is_keep_alive_for_gc %} |
| 152 // Keep the wrapper object for the return value alive as long as |this| | 152 // Keep the wrapper object for the return value alive as long as |this| |
| 153 // object is alive in order to save creation time of the wrapper object. | 153 // object is alive in order to save creation time of the wrapper object. |
| 154 if ({{attribute.cpp_value}} && DOMDataStore::SetReturnValue{{world_suffix}}(in
fo.GetReturnValue(), {{attribute.cpp_value}})) | 154 if ({{attribute.cpp_value}} && DOMDataStore::SetReturnValue{{world_suffix}}(in
fo.GetReturnValue(), {{attribute.cpp_value_to_script_wrappable}})) |
| 155 return; | 155 return; |
| 156 v8::Local<v8::Value> v8Value(ToV8({{attribute.cpp_value}}, holder, info.GetIso
late())); | 156 v8::Local<v8::Value> v8Value(ToV8({{attribute.cpp_value_to_script_wrappable}},
holder, info.GetIsolate())); |
| 157 V8PrivateProperty::GetSymbol( | 157 V8PrivateProperty::GetSymbol( |
| 158 info.GetIsolate(), "KeepAlive#{{interface_name}}#{{attribute.name}}") | 158 info.GetIsolate(), "KeepAlive#{{interface_name}}#{{attribute.name}}") |
| 159 .Set(holder, v8Value); | 159 .Set(holder, v8Value); |
| 160 {% endif %} | 160 {% endif %} |
| 161 | 161 |
| 162 {% if world_suffix %} | 162 {% if world_suffix %} |
| 163 {{attribute.v8_set_return_value_for_main_world}}; | 163 {{attribute.v8_set_return_value_for_main_world}}; |
| 164 {% else %} | 164 {% else %} |
| 165 {{attribute.v8_set_return_value}}; | 165 {{attribute.v8_set_return_value}}; |
| 166 {% endif %} | 166 {% endif %} |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration[] =
{ | 518 static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration[] =
{ |
| 519 {{attribute_configuration(attribute)}} | 519 {{attribute_configuration(attribute)}} |
| 520 }; | 520 }; |
| 521 for (const auto& accessorConfig : accessorConfiguration) | 521 for (const auto& accessorConfig : accessorConfiguration) |
| 522 V8DOMConfiguration::InstallAccessor(isolate, world, v8::Local<v8::Object>(), p
rototypeObject, interfaceObject, signature, accessorConfig); | 522 V8DOMConfiguration::InstallAccessor(isolate, world, v8::Local<v8::Object>(), p
rototypeObject, interfaceObject, signature, accessorConfig); |
| 523 {% endfilter %}{# runtime_enabled #} | 523 {% endfilter %}{# runtime_enabled #} |
| 524 {% endfilter %}{# secure_context #} | 524 {% endfilter %}{# secure_context #} |
| 525 {% endfilter %}{# exposed #} | 525 {% endfilter %}{# exposed #} |
| 526 {% endfor %} | 526 {% endfor %} |
| 527 {% endmacro %} | 527 {% endmacro %} |
| OLD | NEW |