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

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

Issue 1107523002: IDL: Drop [PerContextEnabled] extended attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased 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
OLDNEW
1 {% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_l ocal_cpp_value %} 1 {% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_l ocal_cpp_value %}
2 2
3 3
4 {##############################################################################} 4 {##############################################################################}
5 {% macro generate_method(method, world_suffix) %} 5 {% macro generate_method(method, world_suffix) %}
6 {% filter conditional(method.conditional_string) %} 6 {% filter conditional(method.conditional_string) %}
7 {% if method.returns_promise and method.has_exception_state %} 7 {% if method.returns_promise and method.has_exception_state %}
8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e) 8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e)
9 {% else %} 9 {% else %}
10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) 10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(isolate, {{method.function_template}}, {{metho d.signature}}, {{property_attribute}}, {{method.name}}MethodConfiguration); 628 V8DOMConfiguration::installMethod(isolate, {{method.function_template}}, {{metho d.signature}}, {{property_attribute}}, {{method.name}}MethodConfiguration);
629 {%- endmacro %} 629 {%- endmacro %}
630 630
631 {######################################} 631 {######################################}
632 {% macro install_conditionally_enabled_methods() %} 632 {% macro install_conditionally_enabled_methods() %}
633 {% if conditionally_enabled_methods %} 633 {% if conditionally_enabled_methods %}
634 {# Define per-context enabled operations #} 634 {# Define operations with limited exposure #}
635 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTempl ate(isolate)); 635 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTempl ate(isolate));
636 ExecutionContext* context = toExecutionContext(prototypeObject->CreationContext( )); 636 ExecutionContext* context = toExecutionContext(prototypeObject->CreationContext( ));
637 ASSERT(context); 637 ASSERT(context);
638 {% for method in conditionally_enabled_methods %} 638 {% for method in conditionally_enabled_methods %}
639 {% filter per_context_enabled(method.overloads.per_context_enabled_function_all
640 if method.overloads else
641 method.per_context_enabled_function) %}
642 {% filter exposed(method.overloads.exposed_test_all 639 {% filter exposed(method.overloads.exposed_test_all
643 if method.overloads else 640 if method.overloads else
644 method.exposed_test) %} 641 method.exposed_test) %}
645 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all 642 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all
646 if method.overloads else 643 if method.overloads else
647 method.runtime_enabled_function) %} 644 method.runtime_enabled_function) %}
648 prototypeObject->Set(v8AtomicString(isolate, "{{method.name}}"), v8::FunctionTem plate::New(isolate, {{cpp_class_or_partial}}V8Internal::{{method.name}}MethodCal lback, v8Undefined(), defaultSignature, {{method.number_of_required_arguments}}) ->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); 645 prototypeObject->Set(v8AtomicString(isolate, "{{method.name}}"), v8::FunctionTem plate::New(isolate, {{cpp_class_or_partial}}V8Internal::{{method.name}}MethodCal lback, v8Undefined(), defaultSignature, {{method.number_of_required_arguments}}) ->GetFunction(isolate->GetCurrentContext()).ToLocalChecked());
649 {% endfilter %}{# runtime_enabled() #} 646 {% endfilter %}{# runtime_enabled() #}
650 {% endfilter %}{# exposed() #} 647 {% endfilter %}{# exposed() #}
651 {% endfilter %}{# per_context_enabled() #}
652 {% endfor %} 648 {% endfor %}
653 {% endif %} 649 {% endif %}
654 {%- endmacro %} 650 {%- endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/interface_base.cpp ('k') | Source/bindings/tests/idls/core/TestImplements.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698