Chromium Code Reviews| 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 {% if attribute.has_custom_getter %} | 239 {% if attribute.has_custom_getter %} |
| 240 {{v8_class}}::{{attribute.name}}AttributeGetterCustom(info); | 240 {{v8_class}}::{{attribute.name}}AttributeGetterCustom(info); |
| 241 {% else %} | 241 {% else %} |
| 242 {{cpp_class_or_partial}}V8Internal::{{attribute.name}}AttributeGetter{{world_s uffix}}(info); | 242 {{cpp_class_or_partial}}V8Internal::{{attribute.name}}AttributeGetter{{world_s uffix}}(info); |
| 243 {% endif %} | 243 {% endif %} |
| 244 } | 244 } |
| 245 {% endmacro %} | 245 {% endmacro %} |
| 246 | 246 |
| 247 | 247 |
| 248 {##############################################################################} | 248 {##############################################################################} |
| 249 {% macro attribute_cache_property_callback(attribute) %} | 249 {% macro attribute_cache_property_key(attribute) %} |
|
Yuki
2017/03/24 07:00:29
Should this be attribute_cache"d"_property_key to
peria
2017/03/24 08:44:34
Done.
| |
| 250 v8::Local<v8::Private> {{v8_class_or_partial}}::{{attribute.name}}CachedAccessor Callback(v8::Isolate* isolate) | 250 v8::Local<v8::Private> {{v8_class_or_partial}}::{{attribute.name}}CachedProperty Key(v8::Isolate* isolate) |
| 251 { | 251 { |
| 252 return V8PrivateProperty::get{{attribute.cached_accessor_name}}(isolate).get Private(); | 252 return V8PrivateProperty::get{{attribute.cached_accessor_name}}(isolate).getPr ivate(); |
| 253 } | 253 } |
| 254 {% endmacro %} | 254 {% endmacro %} |
| 255 | 255 |
| 256 | 256 |
| 257 {##############################################################################} | 257 {##############################################################################} |
| 258 {% macro constructor_getter_callback(attribute, world_suffix) %} | 258 {% macro constructor_getter_callback(attribute, world_suffix) %} |
| 259 void {{v8_class_or_partial}}::{{attribute.name}}ConstructorGetterCallback{{world _suffix}}(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value >& info) { | 259 void {{v8_class_or_partial}}::{{attribute.name}}ConstructorGetterCallback{{world _suffix}}(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value >& info) { |
| 260 {% if attribute.deprecate_as %} | 260 {% if attribute.deprecate_as %} |
| 261 Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseC ounter::{{attribute.deprecate_as}}); | 261 Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseC ounter::{{attribute.deprecate_as}}); |
| 262 {% endif %} | 262 {% endif %} |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 473 {% set setter_callback = '%s::%sAttributeSetterCallback' % | 473 {% set setter_callback = '%s::%sAttributeSetterCallback' % |
| 474 (v8_class_or_partial, attribute.name) | 474 (v8_class_or_partial, attribute.name) |
| 475 if attribute.has_setter else 'nullptr' %} | 475 if attribute.has_setter else 'nullptr' %} |
| 476 {% endif %} | 476 {% endif %} |
| 477 {% set wrapper_type_info = | 477 {% set wrapper_type_info = |
| 478 'const_cast<WrapperTypeInfo*>(&V8%s::wrapperTypeInfo)' % attribute.constr uctor_type | 478 'const_cast<WrapperTypeInfo*>(&V8%s::wrapperTypeInfo)' % attribute.constr uctor_type |
| 479 if attribute.constructor_type else 'nullptr' %} | 479 if attribute.constructor_type else 'nullptr' %} |
| 480 {% set property_attribute = 'static_cast<v8::PropertyAttribute>(%s)' % | 480 {% set property_attribute = 'static_cast<v8::PropertyAttribute>(%s)' % |
| 481 ' | '.join(attribute.property_attributes) %} | 481 ' | '.join(attribute.property_attributes) %} |
| 482 {% set cached_accessor_callback = | 482 {% set cached_accessor_callback = |
| 483 '%s::%sCachedAccessorCallback' % (v8_class_or_partial, attribute.name) | 483 '%s::%sCachedPropertyKey' % (v8_class_or_partial, attribute.name) |
| 484 if attribute.is_cached_accessor else | 484 if attribute.is_cached_accessor else |
| 485 'nullptr' %} | 485 'nullptr' %} |
| 486 {% set holder_check = 'V8DOMConfiguration::DoNotCheckHolder' | 486 {% set holder_check = 'V8DOMConfiguration::DoNotCheckHolder' |
| 487 if attribute.is_lenient_this else 'V8DOMConfiguration::CheckHolder' %} | 487 if attribute.is_lenient_this else 'V8DOMConfiguration::CheckHolder' %} |
| 488 {% if attribute.is_per_world_bindings %} | 488 {% if attribute.is_per_world_bindings %} |
| 489 {% set getter_callback_for_main_world = '%sForMainWorld' % getter_callback %} | 489 {% set getter_callback_for_main_world = '%sForMainWorld' % getter_callback %} |
| 490 {% set setter_callback_for_main_world = | 490 {% set setter_callback_for_main_world = |
| 491 '%sForMainWorld' % setter_callback | 491 '%sForMainWorld' % setter_callback |
| 492 if attribute.has_setter else 'nullptr' %} | 492 if attribute.has_setter else 'nullptr' %} |
| 493 {"{{attribute.name}}", {{getter_callback_for_main_world}}, {{setter_callback_for _main_world}}, {{cached_accessor_callback}}, {{wrapper_type_info}}, {{property_a ttribute}}, {{property_location(attribute)}}, {{holder_check}}, V8DOMConfigurati on::MainWorld}, | 493 {"{{attribute.name}}", {{getter_callback_for_main_world}}, {{setter_callback_for _main_world}}, {{cached_accessor_callback}}, {{wrapper_type_info}}, {{property_a ttribute}}, {{property_location(attribute)}}, {{holder_check}}, V8DOMConfigurati on::MainWorld}, |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 506 static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration[] = { | 506 static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration[] = { |
| 507 {{attribute_configuration(attribute)}} | 507 {{attribute_configuration(attribute)}} |
| 508 }; | 508 }; |
| 509 for (const auto& accessorConfig : accessorConfiguration) | 509 for (const auto& accessorConfig : accessorConfiguration) |
| 510 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(), p rototypeObject, interfaceObject, signature, accessorConfig); | 510 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(), p rototypeObject, interfaceObject, signature, accessorConfig); |
| 511 {% endfilter %}{# runtime_enabled #} | 511 {% endfilter %}{# runtime_enabled #} |
| 512 {% endfilter %}{# secure_context #} | 512 {% endfilter %}{# secure_context #} |
| 513 {% endfilter %}{# exposed #} | 513 {% endfilter %}{# exposed #} |
| 514 {% endfor %} | 514 {% endfor %} |
| 515 {% endmacro %} | 515 {% endmacro %} |
| OLD | NEW |