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

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

Issue 922233002: bindings: Makes runtime-enabled attributes on prototype chains compilable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed review comments. Created 5 years, 10 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 {##############################################################################} 1 {##############################################################################}
2 {% macro generate_method(method, world_suffix) %} 2 {% macro generate_method(method, world_suffix) %}
3 {% filter conditional(method.conditional_string) %} 3 {% filter conditional(method.conditional_string) %}
4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) 4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
5 { 5 {
6 {# Local variables #} 6 {# Local variables #}
7 {% if method.has_exception_state %} 7 {% if method.has_exception_state %}
8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); 8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate());
9 {% endif %} 9 {% endif %}
10 {# Overloaded methods have length checked during overload resolution #} 10 {# Overloaded methods have length checked during overload resolution #}
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 {% set method_callback_for_main_world = '%sForMainWorld' % method_callback 617 {% set method_callback_for_main_world = '%sForMainWorld' % method_callback
618 if method.is_per_world_bindings else '0' %} 618 if method.is_per_world_bindings else '0' %}
619 {% set method_length = method.overloads.length if method.overloads else method.l ength %} 619 {% set method_length = method.overloads.length if method.overloads else method.l ength %}
620 {% set property_attribute = 620 {% set property_attribute =
621 'static_cast<v8::PropertyAttribute>(%s)' % ' | '.join(method.property_attribut es) 621 'static_cast<v8::PropertyAttribute>(%s)' % ' | '.join(method.property_attribut es)
622 if method.property_attributes else 'v8::None' %} 622 if method.property_attributes else 'v8::None' %}
623 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat eScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::Expo sedToAllScripts' %} 623 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat eScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::Expo sedToAllScripts' %}
624 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = { 624 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {
625 "{{method.name}}", {{method_callback}}, {{method_callback_for_main_world}}, {{method_length}}, {{only_exposed_to_private_script}}, 625 "{{method.name}}", {{method_callback}}, {{method_callback_for_main_world}}, {{method_length}}, {{only_exposed_to_private_script}},
626 }; 626 };
627 V8DOMConfiguration::installMethod({{method.function_template}}, {{method.signatu re}}, {{property_attribute}}, {{method.name}}MethodConfiguration, isolate); 627 V8DOMConfiguration::installMethod(isolate, {{method.function_template}}, {{metho d.signature}}, {{property_attribute}}, {{method.name}}MethodConfiguration);
628 {%- endmacro %} 628 {%- endmacro %}
629 629
630 {######################################} 630 {######################################}
631 {% macro install_conditionally_enabled_methods() %} 631 {% macro install_conditionally_enabled_methods() %}
632 void {{v8_class_or_partial}}::installConditionallyEnabledMethods(v8::Local<v8::O bject> prototypeObject, v8::Isolate* isolate) 632 void {{v8_class_or_partial}}::installConditionallyEnabledMethods(v8::Local<v8::O bject> prototypeObject, v8::Isolate* isolate)
633 { 633 {
634 {% if is_partial %} 634 {% if is_partial %}
635 {{v8_class}}::installConditionallyEnabledMethods(prototypeObject, isolate); 635 {{v8_class}}::installConditionallyEnabledMethods(prototypeObject, isolate);
636 {% endif %} 636 {% endif %}
637 {% if conditionally_enabled_methods %} 637 {% if conditionally_enabled_methods %}
(...skipping 13 matching lines...) Expand all
651 if method.overloads else 651 if method.overloads else
652 method.runtime_enabled_function) %} 652 method.runtime_enabled_function) %}
653 prototypeObject->Set(v8AtomicString(isolate, "{{method.name}}"), v8::Functio nTemplate::New(isolate, {{cpp_class_or_partial}}V8Internal::{{method.name}}Metho dCallback, v8Undefined(), defaultSignature, {{method.number_of_required_argument s}})->GetFunction()); 653 prototypeObject->Set(v8AtomicString(isolate, "{{method.name}}"), v8::Functio nTemplate::New(isolate, {{cpp_class_or_partial}}V8Internal::{{method.name}}Metho dCallback, v8Undefined(), defaultSignature, {{method.number_of_required_argument s}})->GetFunction());
654 {% endfilter %}{# runtime_enabled() #} 654 {% endfilter %}{# runtime_enabled() #}
655 {% endfilter %}{# exposed() #} 655 {% endfilter %}{# exposed() #}
656 {% endfilter %}{# per_context_enabled() #} 656 {% endfilter %}{# per_context_enabled() #}
657 {% endfor %} 657 {% endfor %}
658 {% endif %} 658 {% endif %}
659 } 659 }
660 {%- endmacro %} 660 {%- endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/interface_base.cpp ('k') | Source/bindings/tests/results/core/V8TestException.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698