Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: Source/bindings/templates/interface_base.cpp

Issue 1017733003: [DO NOT LAND] Set @@toStringTag for DOM object prototypes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Test expectations Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 {% include 'copyright_block.txt' %} 1 {% include 'copyright_block.txt' %}
2 #include "config.h" 2 #include "config.h"
3 {% filter conditional(conditional_string) %} 3 {% filter conditional(conditional_string) %}
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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 462
463 prototypeTemplate->SetInternalFieldCount(V8Window::internalFieldCount); 463 prototypeTemplate->SetInternalFieldCount(V8Window::internalFieldCount);
464 functionTemplate->SetHiddenPrototype(true); 464 functionTemplate->SetHiddenPrototype(true);
465 instanceTemplate->SetInternalFieldCount(V8Window::internalFieldCount); 465 instanceTemplate->SetInternalFieldCount(V8Window::internalFieldCount);
466 {% elif interface_name in [ 466 {% elif interface_name in [
467 'HTMLDocument', 'DedicatedWorkerGlobalScope', 'CompositorWorkerGlobal Scope', 467 'HTMLDocument', 'DedicatedWorkerGlobalScope', 'CompositorWorkerGlobal Scope',
468 'SharedWorkerGlobalScope', 'ServiceWorkerGlobalScope'] %} 468 'SharedWorkerGlobalScope', 'ServiceWorkerGlobalScope'] %}
469 functionTemplate->SetHiddenPrototype(true); 469 functionTemplate->SetHiddenPrototype(true);
470 {% endif %} 470 {% endif %}
471 471
472 {# Willful violation of WebIDL 4.5.4 and 4.7 - implement the class string
473 for interfaces via @@toStringTag on the prototype. WebIDL requires
474 @@toStringTag instances and prototype (with 'Prototype' appended) but
475 this has performance concerns and may not be necessary for web compat.
476 https://www.w3.org/Bugs/Public/show_bug.cgi?id=28244 #}
477 prototypeTemplate->Set(v8::Symbol::GetToStringTag(isolate), v8AtomicString(i solate, "{{interface_name}}"));
478
472 // Custom toString template 479 // Custom toString template
473 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate()); 480 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate());
474 {% endif %} 481 {% endif %}
475 } 482 }
476 483
477 {% endif %}{# not is_array_buffer_or_view #} 484 {% endif %}{# not is_array_buffer_or_view #}
478 {% endblock %} 485 {% endblock %}
479 {##############################################################################} 486 {##############################################################################}
480 {% block get_dom_template %}{% endblock %} 487 {% block get_dom_template %}{% endblock %}
481 {% block has_instance %}{% endblock %} 488 {% block has_instance %}{% endblock %}
(...skipping 11 matching lines...) Expand all
493 {% endfor %} 500 {% endfor %}
494 {% for attribute in attributes if attribute.is_implemented_in_private_script %} 501 {% for attribute in attributes if attribute.is_implemented_in_private_script %}
495 {{attribute_getter_implemented_in_private_script(attribute)}} 502 {{attribute_getter_implemented_in_private_script(attribute)}}
496 {% if attribute.has_setter %} 503 {% if attribute.has_setter %}
497 {{attribute_setter_implemented_in_private_script(attribute)}} 504 {{attribute_setter_implemented_in_private_script(attribute)}}
498 {% endif %} 505 {% endif %}
499 {% endfor %} 506 {% endfor %}
500 {% block partial_interface %}{% endblock %} 507 {% block partial_interface %}{% endblock %}
501 } // namespace blink 508 } // namespace blink
502 {% endfilter %} 509 {% endfilter %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698