OLD | NEW |
---|---|
1 {% include 'copyright_block.txt' %} | 1 {% include 'copyright_block.txt' %} |
2 #include "{{v8_class_or_partial}}.h" | 2 #include "{{v8_class_or_partial}}.h" |
3 | 3 |
4 {% for filename in cpp_includes if filename != '%s.h' % cpp_class_or_partial %} | 4 {% for filename in cpp_includes if filename != '%s.h' % cpp_class_or_partial %} |
5 #include "{{filename}}" | 5 #include "{{filename}}" |
6 {% endfor %} | 6 {% endfor %} |
7 | 7 |
8 namespace blink { | 8 namespace blink { |
9 {% set to_active_scriptwrappable = '%s::toActiveScriptWrappable' % v8_class | 9 {% set to_active_scriptwrappable = '%s::toActiveScriptWrappable' % v8_class |
10 if active_scriptwrappable else '0' %} | 10 if active_scriptwrappable else '0' %} |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
358 {% endif %} | 358 {% endif %} |
359 {% endfilter %} | 359 {% endfilter %} |
360 {% endfilter %} | 360 {% endfilter %} |
361 {% endfor %} | 361 {% endfor %} |
362 {% endif %} | 362 {% endif %} |
363 } | 363 } |
364 | 364 |
365 {% endif %}{# not is_array_buffer_or_view #} | 365 {% endif %}{# not is_array_buffer_or_view #} |
366 {% endblock %} | 366 {% endblock %} |
367 {##############################################################################} | 367 {##############################################################################} |
368 {% block origin_trials %} | |
369 {% from 'attributes.cpp' import attribute_configuration with context %} | |
370 {% for group in attributes|origin_trial_enabled_attributes|groupby('origin_trial _feature_name') %}{{newline}} | |
371 void {{v8_class_or_partial}}::install{{group.grouper}}(ScriptState* scriptState, v8::Local<v8::Object> instance) | |
372 { | |
373 v8::Local<v8::Object> prototype = instance->GetPrototype()->ToObject(scriptS tate->isolate()); | |
374 {% for attribute in group.list | unique_by('name') | sort %} | |
375 {% if attribute.is_data_type_property %} | |
376 const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}} Configuration = \ | |
377 {{attribute_configuration(attribute)}}; | |
378 V8DOMConfiguration::installAttribute(scriptState->isolate(), scriptState->wo rld(), instance, prototype, attribute{{attribute.name}}Configuration); | |
379 {% else %} | |
380 v8::Local<v8::Signature> signature; | |
381 // This parameter is required for installAccessor, to allow for binding | |
382 // static attributes to existing interfaces. This is not currently | |
haraken
2016/05/31 00:16:32
to install static attributes on existing interface
iclelland
2016/05/31 03:17:31
Done. Also clarified that static attributes are on
| |
383 // supported, and is unused by installAccessor. (An assertion in the | |
384 // bindings generation code ensures this.) | |
385 // TODO(iclelland): Replace this with the actual interface, to allow origin | |
386 // trials on static attributes. (crbug.com/614352) | |
387 v8::Local<v8::Function> interface = v8::Function::New(scriptState->context() , nullptr).ToLocalChecked(); | |
388 const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Co nfiguration = \ | |
389 {{attribute_configuration(attribute)}}; | |
390 V8DOMConfiguration::installAccessor(scriptState->isolate(), scriptState->wor ld(), instance, prototype, interface, signature, accessor{{attribute.name}}Confi guration); | |
391 {% endif %} | |
392 {% endfor %} | |
393 } | |
394 {% endfor %} | |
395 {% endblock %} | |
396 {##############################################################################} | |
368 {% block get_dom_template %}{% endblock %} | 397 {% block get_dom_template %}{% endblock %} |
369 {% block get_dom_template_for_named_properties_object %}{% endblock %} | 398 {% block get_dom_template_for_named_properties_object %}{% endblock %} |
370 {% block has_instance %}{% endblock %} | 399 {% block has_instance %}{% endblock %} |
371 {% block to_impl %}{% endblock %} | 400 {% block to_impl %}{% endblock %} |
372 {% block to_impl_with_type_check %}{% endblock %} | 401 {% block to_impl_with_type_check %}{% endblock %} |
373 {% block install_conditional_attributes %}{% endblock %} | 402 {% block install_conditional_attributes %}{% endblock %} |
374 {##############################################################################} | 403 {##############################################################################} |
375 {% block prepare_prototype_and_interface_object %}{% endblock %} | 404 {% block prepare_prototype_and_interface_object %}{% endblock %} |
376 {##############################################################################} | 405 {##############################################################################} |
377 {% block to_active_scriptwrappable %}{% endblock %} | 406 {% block to_active_scriptwrappable %}{% endblock %} |
378 {% for method in methods if method.is_implemented_in_private_script and method.v isible %} | 407 {% for method in methods if method.is_implemented_in_private_script and method.v isible %} |
379 {{method_implemented_in_private_script(method)}} | 408 {{method_implemented_in_private_script(method)}} |
380 {% endfor %} | 409 {% endfor %} |
381 {% for attribute in attributes if attribute.is_implemented_in_private_script %} | 410 {% for attribute in attributes if attribute.is_implemented_in_private_script %} |
382 {{attribute_getter_implemented_in_private_script(attribute)}} | 411 {{attribute_getter_implemented_in_private_script(attribute)}} |
383 {% if attribute.has_setter %} | 412 {% if attribute.has_setter %} |
384 {{attribute_setter_implemented_in_private_script(attribute)}} | 413 {{attribute_setter_implemented_in_private_script(attribute)}} |
385 {% endif %} | 414 {% endif %} |
386 {% endfor %} | 415 {% endfor %} |
387 {% block partial_interface %}{% endblock %} | 416 {% block partial_interface %}{% endblock %} |
388 } // namespace blink | 417 } // namespace blink |
OLD | NEW |