Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 622 'static_cast<v8::PropertyAttribute>(%s)' % ' | '.join(method.property_attribut es) | 622 'static_cast<v8::PropertyAttribute>(%s)' % ' | '.join(method.property_attribut es) |
| 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(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() %} |
|
Jens Widell
2015/04/23 05:58:06
Turns out we can't simply remove this by dropping
| |
| 633 void {{v8_class_or_partial}}::installConditionallyEnabledMethods(v8::Local<v8::O bject> 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 | |
| 646 if method.overloads else | |
| 647 method.per_context_enabled_function) %} | |
| 648 {% filter exposed(method.overloads.exposed_test_all | 645 {% filter exposed(method.overloads.exposed_test_all |
| 649 if method.overloads else | 646 if method.overloads else |
| 650 method.exposed_test) %} | 647 method.exposed_test) %} |
| 651 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all | 648 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all |
| 652 if method.overloads else | 649 if method.overloads else |
| 653 method.runtime_enabled_function) %} | 650 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(isolate->GetCurrentContext()).ToLocalChecked()); | 651 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(isolate->GetCurrentContext()).ToLocalChecked()); |
| 655 {% endfilter %}{# runtime_enabled() #} | 652 {% endfilter %}{# runtime_enabled() #} |
| 656 {% endfilter %}{# exposed() #} | 653 {% endfilter %}{# exposed() #} |
| 657 {% endfilter %}{# per_context_enabled() #} | |
| 658 {% endfor %} | 654 {% endfor %} |
| 659 {% endif %} | 655 {% endif %} |
| 660 } | 656 } |
| 661 {%- endmacro %} | 657 {%- endmacro %} |
| OLD | NEW |