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

Unified Diff: Source/bindings/templates/interface.cpp

Issue 299203002: Support per-overload [RuntimeEnabled] extended attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/templates/interface.cpp
diff --git a/Source/bindings/templates/interface.cpp b/Source/bindings/templates/interface.cpp
index 7078e454decd8f034d5359708d056b968aef5bfb..421bcb09427bf54a557d166e7dfb5c04e2a2f689 100644
--- a/Source/bindings/templates/interface.cpp
+++ b/Source/bindings/templates/interface.cpp
@@ -986,9 +986,10 @@ static void configure{{v8_class}}Template(v8::Handle<v8::FunctionTemplate> funct
{# Needed for legacy support of document.all #}
functionTemplate->InstanceTemplate()->MarkAsUndetectable();
{% endif %}
- {% for method in methods if not method.do_not_check_signature %}
+ {% for method in methods %}
{# install_custom_signature #}
- {% if not method.overload_index or method.overload_index == 1 %}
+ {% if not(method.overloads.do_not_check_signature_all if method.overloads else
+ (method.overload_index or method.do_not_check_signature)) %}
{# For overloaded methods, only generate one accessor #}
{% filter conditional(method.conditional_string) %}
{% if method.is_do_not_check_security %}
@@ -1002,18 +1003,20 @@ static void configure{{v8_class}}Template(v8::Handle<v8::FunctionTemplate> funct
{{install_do_not_check_security_signature(method)}}
{% endif %}
{% else %}{# is_do_not_check_security #}
+ {% set runtime_enabled_function = method.overloads.runtime_enabled_function_all if method.overloads else
+ method.runtime_enabled_function %}
{% if method.is_per_world_bindings %}
if (DOMWrapperWorld::current(isolate).isMainWorld()) {
- {% filter runtime_enabled(method.runtime_enabled_function) %}
+ {% filter runtime_enabled(runtime_enabled_function) %}
{{install_custom_signature(method, 'ForMainWorld')}}
{% endfilter %}
} else {
- {% filter runtime_enabled(method.runtime_enabled_function) %}
+ {% filter runtime_enabled(runtime_enabled_function) %}
{{install_custom_signature(method)}}
{% endfilter %}
}
{% else %}
- {% filter runtime_enabled(method.runtime_enabled_function) %}
+ {% filter runtime_enabled(runtime_enabled_function) %}
{{install_custom_signature(method)}}
{% endfilter %}
{% endif %}

Powered by Google App Engine
This is Rietveld 408576698