OLD | NEW |
1 {% filter format_blink_cpp_source_code %} | 1 {% filter format_blink_cpp_source_code %} |
2 | 2 |
3 {% include 'copyright_block.txt' %} | 3 {% include 'copyright_block.txt' %} |
4 #include "{{v8_class_or_partial}}.h" | 4 #include "{{v8_class_or_partial}}.h" |
5 | 5 |
6 {% for filename in cpp_includes if filename != '%s.h' % cpp_class_or_partial %} | 6 {% for filename in cpp_includes if filename != '%s.h' % cpp_class_or_partial %} |
7 #include "{{filename}}" | 7 #include "{{filename}}" |
8 {% endfor %} | 8 {% endfor %} |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 {##############################################################################} | 332 {##############################################################################} |
333 {% block install_attributes %} | 333 {% block install_attributes %} |
334 {% from 'attributes.cpp.tmpl' import attribute_configuration with context %} | 334 {% from 'attributes.cpp.tmpl' import attribute_configuration with context %} |
335 {% if data_attributes %} | 335 {% if data_attributes %} |
336 // Suppress warning: global constructors, because AttributeConfiguration is triv
ial | 336 // Suppress warning: global constructors, because AttributeConfiguration is triv
ial |
337 // and does not depend on another global objects. | 337 // and does not depend on another global objects. |
338 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 338 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
339 #pragma clang diagnostic push | 339 #pragma clang diagnostic push |
340 #pragma clang diagnostic ignored "-Wglobal-constructors" | 340 #pragma clang diagnostic ignored "-Wglobal-constructors" |
341 #endif | 341 #endif |
342 const V8DOMConfiguration::AttributeConfiguration {{v8_class}}Attributes[] = { | 342 static const V8DOMConfiguration::AttributeConfiguration {{v8_class}}Attributes[]
= { |
343 {% for data_attribute in data_attributes %} | 343 {% for data_attribute in data_attributes %} |
344 {{attribute_configuration(data_attribute)}}, | 344 {{attribute_configuration(data_attribute) | indent(4)}}, |
345 {% endfor %} | 345 {% endfor %} |
346 }; | 346 }; |
347 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 347 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
348 #pragma clang diagnostic pop | 348 #pragma clang diagnostic pop |
349 #endif | 349 #endif |
350 | 350 |
351 {% endif %} | 351 {% endif %} |
352 {% endblock %} | 352 {% endblock %} |
353 {##############################################################################} | 353 {##############################################################################} |
354 {% block install_lazy_data_attributes %} | 354 {% block install_lazy_data_attributes %} |
355 {% from 'attributes.cpp.tmpl' import attribute_configuration with context %} | 355 {% from 'attributes.cpp.tmpl' import attribute_configuration with context %} |
356 {% if lazy_data_attributes %} | 356 {% if lazy_data_attributes %} |
357 // Suppress warning: global constructors, because AttributeConfiguration is triv
ial | 357 // Suppress warning: global constructors, because AttributeConfiguration is triv
ial |
358 // and does not depend on another global objects. | 358 // and does not depend on another global objects. |
359 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 359 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
360 #pragma clang diagnostic push | 360 #pragma clang diagnostic push |
361 #pragma clang diagnostic ignored "-Wglobal-constructors" | 361 #pragma clang diagnostic ignored "-Wglobal-constructors" |
362 #endif | 362 #endif |
363 const V8DOMConfiguration::AttributeConfiguration {{v8_class}}LazyDataAttributes[
] = { | 363 static const V8DOMConfiguration::AttributeConfiguration {{v8_class}}LazyDataAttr
ibutes[] = { |
364 {% for data_attribute in lazy_data_attributes %} | 364 {% for data_attribute in lazy_data_attributes %} |
365 {{attribute_configuration(data_attribute)}}, | 365 {{attribute_configuration(data_attribute) | indent(4)}}, |
366 {% endfor %} | 366 {% endfor %} |
367 }; | 367 }; |
368 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 368 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
369 #pragma clang diagnostic pop | 369 #pragma clang diagnostic pop |
370 #endif | 370 #endif |
371 | 371 |
372 {% endif %} | 372 {% endif %} |
373 {% endblock %} | 373 {% endblock %} |
374 {##############################################################################} | 374 {##############################################################################} |
375 {% block install_accessors %} | 375 {% block install_accessors %} |
376 {% from 'attributes.cpp.tmpl' import attribute_configuration with context %} | 376 {% from 'attributes.cpp.tmpl' import attribute_configuration with context %} |
377 {% if accessors %} | 377 {% if accessors %} |
378 const V8DOMConfiguration::AccessorConfiguration {{v8_class}}Accessors[] = { | 378 static const V8DOMConfiguration::AccessorConfiguration {{v8_class}}Accessors[] =
{ |
379 {% for accessor in accessors %} | 379 {% for accessor in accessors %} |
380 {{attribute_configuration(accessor)}}, | 380 {{attribute_configuration(accessor) | indent(4)}}, |
381 {% endfor %} | 381 {% endfor %} |
382 }; | 382 }; |
383 | 383 |
384 {% endif %} | 384 {% endif %} |
385 {% endblock %} | 385 {% endblock %} |
386 {##############################################################################} | 386 {##############################################################################} |
387 {% block install_methods %} | 387 {% block install_methods %} |
388 {% from 'methods.cpp.tmpl' import method_configuration with context %} | 388 {% from 'methods.cpp.tmpl' import method_configuration with context %} |
389 {% if methods | has_method_configuration(is_partial) %} | 389 {% if methods | has_method_configuration(is_partial) %} |
390 const V8DOMConfiguration::MethodConfiguration {{v8_class}}Methods[] = { | 390 static const V8DOMConfiguration::MethodConfiguration {{v8_class}}Methods[] = { |
391 {% for method in methods | has_method_configuration(is_partial) %} | 391 {% for method in methods | has_method_configuration(is_partial) %} |
392 {{method_configuration(method) | indent(4)}}, | 392 {{method_configuration(method) | indent(4)}}, |
393 {% endfor %} | 393 {% endfor %} |
394 }; | 394 }; |
395 | 395 |
396 {% endif %} | 396 {% endif %} |
397 {% endblock %} | 397 {% endblock %} |
398 {% endif %}{# not is_array_buffer_or_view #} | 398 {% endif %}{# not is_array_buffer_or_view #} |
399 {##############################################################################} | 399 {##############################################################################} |
400 {% block named_constructor %}{% endblock %} | 400 {% block named_constructor %}{% endblock %} |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 {% set cross_origin_named_setter = '%s::crossOriginNamedSetter' % v8_class_or_
partial if has_cross_origin_named_setter else 'nullptr' %} | 478 {% set cross_origin_named_setter = '%s::crossOriginNamedSetter' % v8_class_or_
partial if has_cross_origin_named_setter else 'nullptr' %} |
479 {% set cross_origin_named_enumerator = '%s::crossOriginNamedEnumerator' % v8_c
lass_or_partial if has_cross_origin_named_enumerator else 'nullptr' %} | 479 {% set cross_origin_named_enumerator = '%s::crossOriginNamedEnumerator' % v8_c
lass_or_partial if has_cross_origin_named_enumerator else 'nullptr' %} |
480 {% set cross_origin_indexed_getter = '%s::crossOriginIndexedGetter' % v8_class
_or_partial if has_cross_origin_indexed_getter else 'nullptr' %} | 480 {% set cross_origin_indexed_getter = '%s::crossOriginIndexedGetter' % v8_class
_or_partial if has_cross_origin_indexed_getter else 'nullptr' %} |
481 instanceTemplate->SetAccessCheckCallbackAndHandler({{v8_class_or_partial}}::se
curityCheck, v8::NamedPropertyHandlerConfiguration({{cross_origin_named_getter}}
, {{cross_origin_named_setter}}, nullptr, nullptr, {{cross_origin_named_enumerat
or}}), v8::IndexedPropertyHandlerConfiguration({{cross_origin_indexed_getter}}),
v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&{{v8_class}}::wrapperT
ypeInfo))); | 481 instanceTemplate->SetAccessCheckCallbackAndHandler({{v8_class_or_partial}}::se
curityCheck, v8::NamedPropertyHandlerConfiguration({{cross_origin_named_getter}}
, {{cross_origin_named_setter}}, nullptr, nullptr, {{cross_origin_named_enumerat
or}}), v8::IndexedPropertyHandlerConfiguration({{cross_origin_indexed_getter}}),
v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&{{v8_class}}::wrapperT
ypeInfo))); |
482 {% endif %} | 482 {% endif %} |
483 | 483 |
484 {% for feature_name, attribute_list in runtime_enabled_attributes | groupby('r
untime_enabled_feature_name') %} | 484 {% for feature_name, attribute_list in runtime_enabled_attributes | groupby('r
untime_enabled_feature_name') %} |
485 {% filter runtime_enabled(feature_name) %} | 485 {% filter runtime_enabled(feature_name) %} |
486 {% for attribute in attribute_list | unique_by('name') | sort %} | 486 {% for attribute in attribute_list | unique_by('name') | sort %} |
487 {% if attribute.is_data_type_property %} | 487 {% if attribute.is_data_type_property %} |
488 const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}}Co
nfiguration = {{attribute_configuration(attribute)}}; | 488 static const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.n
ame}}Configuration[] = { |
489 V8DOMConfiguration::installAttribute(isolate, world, instanceTemplate, prototy
peTemplate, attribute{{attribute.name}}Configuration); | 489 {{attribute_configuration(attribute) | indent(2)}} |
| 490 }; |
| 491 for (const auto& attributeConfig : attribute{{attribute.name}}Configuration) |
| 492 V8DOMConfiguration::installAttribute(isolate, world, instanceTemplate, proto
typeTemplate, attributeConfig); |
490 {% else %} | 493 {% else %} |
491 const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Conf
iguration = {{attribute_configuration(attribute)}}; | 494 static const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.nam
e}}Configuration[] = { |
492 V8DOMConfiguration::installAccessor(isolate, world, instanceTemplate, prototyp
eTemplate, interfaceTemplate, signature, accessor{{attribute.name}}Configuration
); | 495 {{attribute_configuration(attribute) | indent(2)}} |
| 496 }; |
| 497 for (const auto& accessorConfig : accessor{{attribute.name}}Configuration) |
| 498 V8DOMConfiguration::installAccessor(isolate, world, instanceTemplate, protot
ypeTemplate, interfaceTemplate, signature, accessorConfig); |
493 {% endif %} | 499 {% endif %} |
494 {% endfor %} | 500 {% endfor %} |
495 {% endfilter %} | 501 {% endfilter %} |
496 {% endfor %} | 502 {% endfor %} |
497 | 503 |
498 {% if (indexed_property_getter or named_property_getter) and not is_partial %} | 504 {% if (indexed_property_getter or named_property_getter) and not is_partial %} |
499 // Indexed properties | 505 // Indexed properties |
500 {{install_indexed_property_handler('instanceTemplate') | indent(2)}} | 506 {{install_indexed_property_handler('instanceTemplate') | indent(2)}} |
501 {% endif %} | 507 {% endif %} |
502 {% if named_property_getter and not is_partial and not has_named_properties_ob
ject %} | 508 {% if named_property_getter and not is_partial and not has_named_properties_ob
ject %} |
(...skipping 14 matching lines...) Expand all Loading... |
517 prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "forEach")
, v8::kArrayProto_forEach); | 523 prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "forEach")
, v8::kArrayProto_forEach); |
518 prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "keys"), v
8::kArrayProto_keys); | 524 prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "keys"), v
8::kArrayProto_keys); |
519 prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "values"),
v8::kArrayProto_values); | 525 prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "values"),
v8::kArrayProto_values); |
520 {% endif %} | 526 {% endif %} |
521 {% endif %} | 527 {% endif %} |
522 | 528 |
523 {% if iterator_method %} | 529 {% if iterator_method %} |
524 {% filter exposed(iterator_method.exposed_test) %} | 530 {% filter exposed(iterator_method.exposed_test) %} |
525 {% filter runtime_enabled(iterator_method.runtime_enabled_feature_name) %} | 531 {% filter runtime_enabled(iterator_method.runtime_enabled_feature_name) %} |
526 // Iterator (@@iterator) | 532 // Iterator (@@iterator) |
527 const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorCo
nfiguration = { v8::Symbol::GetIterator, {{v8_class_or_partial}}::iteratorMethod
Callback, 0, v8::DontEnum, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::
CheckHolder, V8DOMConfiguration::DoNotCheckAccess }; | 533 static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIte
ratorConfiguration = { v8::Symbol::GetIterator, {{v8_class_or_partial}}::iterato
rMethodCallback, 0, v8::DontEnum, V8DOMConfiguration::OnPrototype, V8DOMConfigur
ation::CheckHolder, V8DOMConfiguration::DoNotCheckAccess }; |
528 V8DOMConfiguration::installMethod(isolate, world, prototypeTemplate, signature
, symbolKeyedIteratorConfiguration); | 534 V8DOMConfiguration::installMethod(isolate, world, prototypeTemplate, signature
, symbolKeyedIteratorConfiguration); |
529 {% endfilter %} | 535 {% endfilter %} |
530 {% endfilter %} | 536 {% endfilter %} |
531 {% endif %} | 537 {% endif %} |
532 | 538 |
533 {% if interface_name == 'Location' %} | 539 {% if interface_name == 'Location' %} |
534 // Symbol.toPrimitive | 540 // Symbol.toPrimitive |
535 // Prevent author scripts to inject Symbol.toPrimitive property into location | 541 // Prevent author scripts to inject Symbol.toPrimitive property into location |
536 // objects, also prevent the look-up of Symbol.toPrimitive through the | 542 // objects, also prevent the look-up of Symbol.toPrimitive through the |
537 // prototype chain. | 543 // prototype chain. |
(...skipping 18 matching lines...) Expand all Loading... |
556 {% for method in methods | custom_registration(is_partial) %} | 562 {% for method in methods | custom_registration(is_partial) %} |
557 {# install_custom_signature #} | 563 {# install_custom_signature #} |
558 {% filter exposed(method.overloads.exposed_test_all | 564 {% filter exposed(method.overloads.exposed_test_all |
559 if method.overloads else method.exposed_test) %} | 565 if method.overloads else method.exposed_test) %} |
560 {% filter runtime_enabled(method.overloads.runtime_enabled_all | 566 {% filter runtime_enabled(method.overloads.runtime_enabled_all |
561 if method.overloads else method.runtime_enabled_feat
ure_name) %} | 567 if method.overloads else method.runtime_enabled_feat
ure_name) %} |
562 {% if method.is_cross_origin %} | 568 {% if method.is_cross_origin %} |
563 {# TODO(dcheng): Currently, bindings must create a function object for each | 569 {# TODO(dcheng): Currently, bindings must create a function object for each |
564 realm as a hack to support the incumbent realm. Remove this when Blink | 570 realm as a hack to support the incumbent realm. Remove this when Blink |
565 properly supports the incumbent realm. #} | 571 properly supports the incumbent realm. #} |
566 {{install_origin_safe_method(method, '', 'instanceTemplate', 'prototypeTemplat
e') | indent(2)}} | 572 {{install_origin_safe_method(method, 'instanceTemplate', 'prototypeTemplate')
| indent(2)}} |
567 {% else %} | 573 {% else %} |
568 {{install_custom_signature(method, 'instanceTemplate', 'prototypeTemplate', 'i
nterfaceTemplate', 'signature') | indent(2)}} | 574 {{install_custom_signature(method, 'instanceTemplate', 'prototypeTemplate', 'i
nterfaceTemplate', 'signature') | indent(2)}} |
569 {% endif %} | 575 {% endif %} |
570 {% endfilter %} | 576 {% endfilter %} |
571 {% endfilter %} | 577 {% endfilter %} |
572 {% endfor %} | 578 {% endfor %} |
573 {% endif %} | 579 {% endif %} |
574 } | 580 } |
575 | 581 |
576 {% endif %}{# not is_array_buffer_or_view #} | 582 {% endif %}{# not is_array_buffer_or_view #} |
(...skipping 15 matching lines...) Expand all Loading... |
592 v8::Local<v8::FunctionTemplate> interfaceTemplate = {{v8_class}}::wrapperTypeI
nfo.domTemplate(isolate, world); | 598 v8::Local<v8::FunctionTemplate> interfaceTemplate = {{v8_class}}::wrapperTypeI
nfo.domTemplate(isolate, world); |
593 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp
late); | 599 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp
late); |
594 ALLOW_UNUSED_LOCAL(signature); | 600 ALLOW_UNUSED_LOCAL(signature); |
595 | 601 |
596 {# TODO(peria): Generate code to install constants. It depends on runtime_enab
led_feaure of this interface. #} | 602 {# TODO(peria): Generate code to install constants. It depends on runtime_enab
led_feaure of this interface. #} |
597 | 603 |
598 {% for feature_name, attrs in runtime_enabled_attributes | groupby('runtime_en
abled_feature_name') %} | 604 {% for feature_name, attrs in runtime_enabled_attributes | groupby('runtime_en
abled_feature_name') %} |
599 {% filter runtime_enabled(feature_name) %} | 605 {% filter runtime_enabled(feature_name) %} |
600 {% for attribute in attrs | unique_by('name') | sort %} | 606 {% for attribute in attrs | unique_by('name') | sort %} |
601 {% if attribute.is_data_type_property %} | 607 {% if attribute.is_data_type_property %} |
602 const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}}Co
nfiguration = {{attribute_configuration(attribute)}}; | 608 static const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.n
ame}}Configuration[] = { |
603 V8DOMConfiguration::installAttribute(isolate, world, instance, prototype, attr
ibute{{attribute.name}}Configuration); | 609 {{attribute_configuration(attribute) | indent(2)}} |
| 610 }; |
| 611 for (const auto& attributeConfig : attribute{{attribute.name}}Configuration) |
| 612 V8DOMConfiguration::installAttribute(isolate, world, instance, prototype, at
tributeConfig); |
604 {% else %} | 613 {% else %} |
605 const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Conf
iguration = {{attribute_configuration(attribute)}}; | 614 static const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.nam
e}}Configuration[] = { |
606 V8DOMConfiguration::installAccessor(isolate, world, instance, prototype, inter
face, signature, accessor{{attribute.name}}Configuration); | 615 {{attribute_configuration(attribute) | indent(2)}} |
| 616 }; |
| 617 for (const auto& accessorConfig : accessor{{attribute.name}}Configuration) |
| 618 V8DOMConfiguration::installAccessor(isolate, world, instance, prototype, int
erface, signature, accessorConfig); |
607 {% endif %} | 619 {% endif %} |
608 {% endfor %} | 620 {% endfor %} |
609 {% endfilter %} | 621 {% endfilter %} |
610 {% endfor %} | 622 {% endfor %} |
611 | 623 |
612 {% if iterator_method and iterator_method.runtime_enabled_feature_name %} | 624 {% if iterator_method and iterator_method.runtime_enabled_feature_name %} |
613 {% filter exposed(iterator_method.exposed_test) %} | 625 {% filter exposed(iterator_method.exposed_test) %} |
614 {% filter runtime_enabled(iterator_method.runtime_enabled_feature_name) %} | 626 {% filter runtime_enabled(iterator_method.runtime_enabled_feature_name) %} |
615 // Runtime enabled iterator (@@iterator) | 627 // Runtime enabled iterator (@@iterator) |
616 #error "{{v8_class_or_partial}} should not have runtime enabled iterators." | 628 #error "{{v8_class_or_partial}} should not have runtime enabled iterators." |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 {% for feature in origin_trial_features %} | 660 {% for feature in origin_trial_features %} |
649 void {{v8_class_or_partial}}::install{{feature.name}}(v8::Isolate* isolate, cons
t DOMWrapperWorld& world, v8::Local<v8::Object> instance, v8::Local<v8::Object>
prototype, v8::Local<v8::Function> interface) { | 661 void {{v8_class_or_partial}}::install{{feature.name}}(v8::Isolate* isolate, cons
t DOMWrapperWorld& world, v8::Local<v8::Object> instance, v8::Local<v8::Object>
prototype, v8::Local<v8::Function> interface) { |
650 {% if feature.attributes or feature.methods %} | 662 {% if feature.attributes or feature.methods %} |
651 v8::Local<v8::FunctionTemplate> interfaceTemplate = {{v8_class}}::wrapperTypeI
nfo.domTemplate(isolate, world); | 663 v8::Local<v8::FunctionTemplate> interfaceTemplate = {{v8_class}}::wrapperTypeI
nfo.domTemplate(isolate, world); |
652 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp
late); | 664 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp
late); |
653 ALLOW_UNUSED_LOCAL(signature); | 665 ALLOW_UNUSED_LOCAL(signature); |
654 {% endif %} | 666 {% endif %} |
655 {# Origin-Trial-enabled attributes #} | 667 {# Origin-Trial-enabled attributes #} |
656 {% for attribute in feature.attributes %} | 668 {% for attribute in feature.attributes %} |
657 {% if attribute.is_data_type_property %} | 669 {% if attribute.is_data_type_property %} |
658 const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}}Co
nfiguration = {{attribute_configuration(attribute)}}; | 670 static const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.n
ame}}Configuration[] = { |
659 V8DOMConfiguration::installAttribute(isolate, world, instance, prototype, attr
ibute{{attribute.name}}Configuration); | 671 {{attribute_configuration(attribute) | indent(2)}} |
| 672 }; |
| 673 for (const auto& attributeConfig : attribute{{attribute.name}}Configuration) |
| 674 V8DOMConfiguration::installAttribute(isolate, world, instance, prototype, at
tributeConfig); |
660 {% else %} | 675 {% else %} |
661 const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Conf
iguration = {{attribute_configuration(attribute)}}; | 676 static const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.nam
e}}Configuration[] = { |
662 V8DOMConfiguration::installAccessor(isolate, world, instance, prototype, inter
face, signature, accessor{{attribute.name}}Configuration); | 677 {{attribute_configuration(attribute) | indent(2)}} |
| 678 }; |
| 679 for (const auto& accessorConfig : accessor{{attribute.name}}Configuration) |
| 680 V8DOMConfiguration::installAccessor(isolate, world, instance, prototype, int
erface, signature, accessorConfig); |
663 {% endif %} | 681 {% endif %} |
664 {% endfor %} | 682 {% endfor %} |
665 {# Origin-Trial-enabled constants #} | 683 {# Origin-Trial-enabled constants #} |
666 {% for constant in feature.constants %} | 684 {% for constant in feature.constants %} |
667 {% set constant_name = constant.name.title().replace('_', '') %} | 685 {% set constant_name = constant.name.title().replace('_', '') %} |
668 const V8DOMConfiguration::ConstantConfiguration constant{{constant_name}}Confi
guration = {{constant_configuration(constant)}}; | 686 const V8DOMConfiguration::ConstantConfiguration constant{{constant_name}}Confi
guration = {{constant_configuration(constant)}}; |
669 V8DOMConfiguration::installConstant(isolate, interface, prototype, constant{{c
onstant_name}}Configuration); | 687 V8DOMConfiguration::installConstant(isolate, interface, prototype, constant{{c
onstant_name}}Configuration); |
670 {% endfor %} | 688 {% endfor %} |
671 {# Origin-Trial-enabled methods (no overloads) #} | 689 {# Origin-Trial-enabled methods (no overloads) #} |
672 {% for method in feature.methods %} | 690 {% for method in feature.methods %} |
673 {% set method_name = method.name.title().replace('_', '') %} | 691 {% set method_name = method.name.title().replace('_', '') %} |
674 const V8DOMConfiguration::MethodConfiguration method{{method_name}}Configurati
on[] = { | 692 static const V8DOMConfiguration::MethodConfiguration method{{method_name}}Conf
iguration[] = { |
675 {{method_configuration(method) | indent(2)}} | 693 {{method_configuration(method) | indent(2)}} |
676 }; | 694 }; |
677 for (const auto& methodConfig : method{{method_name}}Configuration) | 695 for (const auto& methodConfig : method{{method_name}}Configuration) |
678 V8DOMConfiguration::installMethod(isolate, world, instance, prototype, inter
face, signature, methodConfig); | 696 V8DOMConfiguration::installMethod(isolate, world, instance, prototype, inter
face, signature, methodConfig); |
679 {% endfor %} | 697 {% endfor %} |
680 } | 698 } |
681 | 699 |
682 void {{v8_class_or_partial}}::install{{feature.name}}(ScriptState* scriptState,
v8::Local<v8::Object> instance) { | 700 void {{v8_class_or_partial}}::install{{feature.name}}(ScriptState* scriptState,
v8::Local<v8::Object> instance) { |
683 V8PerContextData* perContextData = V8PerContextData::from(scriptState->context
()); | 701 V8PerContextData* perContextData = V8PerContextData::from(scriptState->context
()); |
684 v8::Local<v8::Object> prototype = perContextData->prototypeForType(&{{v8_class
}}::wrapperTypeInfo); | 702 v8::Local<v8::Object> prototype = perContextData->prototypeForType(&{{v8_class
}}::wrapperTypeInfo); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 {% endif %} | 759 {% endif %} |
742 } | 760 } |
743 {% endif %} | 761 {% endif %} |
744 | 762 |
745 {% endblock %} | 763 {% endblock %} |
746 {##############################################################################} | 764 {##############################################################################} |
747 {% block partial_interface %}{% endblock %} | 765 {% block partial_interface %}{% endblock %} |
748 } // namespace blink | 766 } // namespace blink |
749 | 767 |
750 {% endfilter %}{# format_blink_cpp_source_code #} | 768 {% endfilter %}{# format_blink_cpp_source_code #} |
OLD | NEW |