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

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

Issue 1366643003: [DO NOT LAND] Set @@toStringTag for DOM object prototypes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 465
466 prototypeTemplate->SetInternalFieldCount(V8Window::internalFieldCount); 466 prototypeTemplate->SetInternalFieldCount(V8Window::internalFieldCount);
467 functionTemplate->SetHiddenPrototype(true); 467 functionTemplate->SetHiddenPrototype(true);
468 instanceTemplate->SetInternalFieldCount(V8Window::internalFieldCount); 468 instanceTemplate->SetInternalFieldCount(V8Window::internalFieldCount);
469 {% elif interface_name in [ 469 {% elif interface_name in [
470 'HTMLDocument', 'DedicatedWorkerGlobalScope', 'CompositorWorkerGlobal Scope', 470 'HTMLDocument', 'DedicatedWorkerGlobalScope', 'CompositorWorkerGlobal Scope',
471 'SharedWorkerGlobalScope', 'ServiceWorkerGlobalScope'] %} 471 'SharedWorkerGlobalScope', 'ServiceWorkerGlobalScope'] %}
472 functionTemplate->SetHiddenPrototype(true); 472 functionTemplate->SetHiddenPrototype(true);
473 {% endif %} 473 {% endif %}
474 474
475 {# Willful violation of WebIDL 4.5.4 and 4.7 - implement the class string
476 for interfaces via @@toStringTag on the prototype. WebIDL requires
477 @@toStringTag instances and prototype (with 'Prototype' appended) but
478 this has performance concerns and may not be necessary for web compat.
479 https://www.w3.org/Bugs/Public/show_bug.cgi?id=28244 #}
480 prototypeTemplate->Set(v8::Symbol::GetToStringTag(isolate), v8AtomicString(i solate, "{{interface_name}}"));
481
475 // Custom toString template 482 // Custom toString template
476 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate()); 483 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate());
477 {% endif %} 484 {% endif %}
478 } 485 }
479 486
480 {% endif %}{# not is_array_buffer_or_view #} 487 {% endif %}{# not is_array_buffer_or_view #}
481 {% endblock %} 488 {% endblock %}
482 {##############################################################################} 489 {##############################################################################}
483 {% block get_dom_template %}{% endblock %} 490 {% block get_dom_template %}{% endblock %}
484 {% block has_instance %}{% endblock %} 491 {% block has_instance %}{% endblock %}
(...skipping 10 matching lines...) Expand all
495 {% endfor %} 502 {% endfor %}
496 {% for attribute in attributes if attribute.is_implemented_in_private_script %} 503 {% for attribute in attributes if attribute.is_implemented_in_private_script %}
497 {{attribute_getter_implemented_in_private_script(attribute)}} 504 {{attribute_getter_implemented_in_private_script(attribute)}}
498 {% if attribute.has_setter %} 505 {% if attribute.has_setter %}
499 {{attribute_setter_implemented_in_private_script(attribute)}} 506 {{attribute_setter_implemented_in_private_script(attribute)}}
500 {% endif %} 507 {% endif %}
501 {% endfor %} 508 {% endfor %}
502 {% block partial_interface %}{% endblock %} 509 {% block partial_interface %}{% endblock %}
503 } // namespace blink 510 } // namespace blink
504 {% endfilter %} 511 {% endfilter %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698