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

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

Issue 1085453003: IDL: Add support for [Unscopeable] on attributes and methods (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 {% filter per_context_enabled(iterator_method.per_context_enabled_function) %} 411 {% filter per_context_enabled(iterator_method.per_context_enabled_function) %}
412 {% filter exposed(iterator_method.exposed_test) %} 412 {% filter exposed(iterator_method.exposed_test) %}
413 {% filter runtime_enabled(iterator_method.runtime_enabled_function) %} 413 {% filter runtime_enabled(iterator_method.runtime_enabled_function) %}
414 static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedI teratorConfiguration = { v8::Symbol::GetIterator, {{cpp_class_or_partial}}V8Inte rnal::iteratorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts }; 414 static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedI teratorConfiguration = { v8::Symbol::GetIterator, {{cpp_class_or_partial}}V8Inte rnal::iteratorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts };
415 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignatu re, v8::DontDelete, symbolKeyedIteratorConfiguration); 415 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignatu re, v8::DontDelete, symbolKeyedIteratorConfiguration);
416 {% endfilter %}{# runtime_enabled() #} 416 {% endfilter %}{# runtime_enabled() #}
417 {% endfilter %}{# exposed() #} 417 {% endfilter %}{# exposed() #}
418 {% endfilter %}{# per_context_enabled() #} 418 {% endfilter %}{# per_context_enabled() #}
419 {% endif %} 419 {% endif %}
420 {# End special operations #} 420 {# End special operations #}
421 {% if unscopeables %}
422 v8::Local<v8::Context> context(isolate->GetCurrentContext());
423 v8::Local<v8::Object> unscopeables(v8::Object::New(isolate));
424 {% for name in unscopeables %}
425 unscopeables->ForceSet(context, v8AtomicString(isolate, "{{name}}"), v8::Tru e(isolate));
426 {% endfor %}
427 prototypeTemplate->Set(v8::Symbol::GetUnscopables(isolate), unscopeables);
haraken 2015/04/20 14:00:13 Should we check a return value of ForceSet and Set
428 {% endif %}
421 {% if has_custom_legacy_call_as_function %} 429 {% if has_custom_legacy_call_as_function %}
422 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler({{v8_class}}: :legacyCallCustom); 430 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler({{v8_class}}: :legacyCallCustom);
423 {% endif %} 431 {% endif %}
424 {% if interface_name == 'HTMLAllCollection' %} 432 {% if interface_name == 'HTMLAllCollection' %}
425 {# Needed for legacy support of document.all #} 433 {# Needed for legacy support of document.all #}
426 functionTemplate->InstanceTemplate()->MarkAsUndetectable(); 434 functionTemplate->InstanceTemplate()->MarkAsUndetectable();
427 {% endif %} 435 {% endif %}
428 {% for method in custom_registration_methods %} 436 {% for method in custom_registration_methods %}
429 {# install_custom_signature #} 437 {# install_custom_signature #}
430 {% filter conditional(method.conditional_string) %} 438 {% filter conditional(method.conditional_string) %}
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 {% endfor %} 509 {% endfor %}
502 {% for attribute in attributes if attribute.is_implemented_in_private_script %} 510 {% for attribute in attributes if attribute.is_implemented_in_private_script %}
503 {{attribute_getter_implemented_in_private_script(attribute)}} 511 {{attribute_getter_implemented_in_private_script(attribute)}}
504 {% if attribute.has_setter %} 512 {% if attribute.has_setter %}
505 {{attribute_setter_implemented_in_private_script(attribute)}} 513 {{attribute_setter_implemented_in_private_script(attribute)}}
506 {% endif %} 514 {% endif %}
507 {% endfor %} 515 {% endfor %}
508 {% block partial_interface %}{% endblock %} 516 {% block partial_interface %}{% endblock %}
509 } // namespace blink 517 } // namespace blink
510 {% endfilter %} 518 {% endfilter %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698