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

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

Issue 822883002: [bindings] Interface functions installConditionallyEnabled[Methods/Properties] should use Local<> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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/templates/interface.cpp ('k') | Source/bindings/templates/partial_interface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 if method.property_attributes else 'v8::None' %} 623 if method.property_attributes else 'v8::None' %}
624 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat eScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::Expo sedToAllScripts' %} 624 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat eScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::Expo sedToAllScripts' %}
625 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = { 625 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {
626 "{{method.name}}", {{method_callback}}, {{method_callback_for_main_world}}, {{method_length}}, {{only_exposed_to_private_script}}, 626 "{{method.name}}", {{method_callback}}, {{method_callback_for_main_world}}, {{method_length}}, {{only_exposed_to_private_script}},
627 }; 627 };
628 V8DOMConfiguration::installMethod({{method.function_template}}, {{method.signatu re}}, {{property_attribute}}, {{method.name}}MethodConfiguration, isolate); 628 V8DOMConfiguration::installMethod({{method.function_template}}, {{method.signatu re}}, {{property_attribute}}, {{method.name}}MethodConfiguration, isolate);
629 {%- endmacro %} 629 {%- endmacro %}
630 630
631 {######################################} 631 {######################################}
632 {% macro install_conditionally_enabled_methods() %} 632 {% macro install_conditionally_enabled_methods() %}
633 void {{v8_class_or_partial}}::installConditionallyEnabledMethods(v8::Handle<v8:: Object> prototypeObject, v8::Isolate* isolate) 633 void {{v8_class_or_partial}}::installConditionallyEnabledMethods(v8::Local<v8::O bject> prototypeObject, v8::Isolate* isolate)
634 { 634 {
635 {% if is_partial %} 635 {% if is_partial %}
636 {{v8_class}}::installConditionallyEnabledMethods(prototypeObject, isolate); 636 {{v8_class}}::installConditionallyEnabledMethods(prototypeObject, isolate);
637 {% endif %} 637 {% endif %}
638 {% if conditionally_enabled_methods %} 638 {% if conditionally_enabled_methods %}
639 {# Define per-context enabled operations #} 639 {# Define per-context enabled operations #}
640 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT emplate(isolate)); 640 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT emplate(isolate));
641 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont ext()); 641 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont ext());
642 ASSERT(context); 642 ASSERT(context);
643 643
644 {% for method in conditionally_enabled_methods %} 644 {% for method in conditionally_enabled_methods %}
645 {% filter per_context_enabled(method.overloads.per_context_enabled_function_ all 645 {% filter per_context_enabled(method.overloads.per_context_enabled_function_ all
646 if method.overloads else 646 if method.overloads else
647 method.per_context_enabled_function) %} 647 method.per_context_enabled_function) %}
648 {% filter exposed(method.overloads.exposed_test_all 648 {% filter exposed(method.overloads.exposed_test_all
649 if method.overloads else 649 if method.overloads else
650 method.exposed_test) %} 650 method.exposed_test) %}
651 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all 651 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all
652 if method.overloads else 652 if method.overloads else
653 method.runtime_enabled_function) %} 653 method.runtime_enabled_function) %}
654 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 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());
655 {% endfilter %}{# runtime_enabled() #} 655 {% endfilter %}{# runtime_enabled() #}
656 {% endfilter %}{# exposed() #} 656 {% endfilter %}{# exposed() #}
657 {% endfilter %}{# per_context_enabled() #} 657 {% endfilter %}{# per_context_enabled() #}
658 {% endfor %} 658 {% endfor %}
659 {% endif %} 659 {% endif %}
660 } 660 }
661 {%- endmacro %} 661 {%- endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/interface.cpp ('k') | Source/bindings/templates/partial_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698