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

Side by Side Diff: third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl

Issue 2721693002: Revert of Switch RemoteWindowProxy to use v8::Context::NewRemoteContext. (Closed)
Patch Set: Created 3 years, 9 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 'utilities.cpp.tmpl' import declare_enum_validation_variable, v8_value_t o_local_cpp_value %} 1 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable, v8_value_t o_local_cpp_value %}
2 2
3 {##############################################################################} 3 {##############################################################################}
4 {% macro generate_method(method, world_suffix) %} 4 {% macro generate_method(method, world_suffix) %}
5 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) { 5 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) {
6 {% filter format_remove_duplicates([ 6 {% filter format_remove_duplicates([
7 'ExceptionState exceptionState', 7 'ExceptionState exceptionState',
8 'ScriptState* scriptState = ']) %} 8 'ScriptState* scriptState = ']) %}
9 {% set define_exception_state -%} 9 {% set define_exception_state -%}
10 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "{{interface_name}}", "{{method.name}}"); 10 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "{{interface_name}}", "{{method.name}}");
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 {% endif %}{# interface_name == 'EventTarget' #} 71 {% endif %}{# interface_name == 'EventTarget' #}
72 {% endif %}{# method.is_check_security_for_receiver #} 72 {% endif %}{# method.is_check_security_for_receiver #}
73 {% if method.is_check_security_for_return_value %} 73 {% if method.is_check_security_for_return_value %}
74 {{define_exception_state}} 74 {{define_exception_state}}
75 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), {{method.cpp_value}}, exceptionState)) { 75 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), {{method.cpp_value}}, exceptionState)) {
76 v8SetReturnValueNull(info); 76 v8SetReturnValueNull(info);
77 return; 77 return;
78 } 78 }
79 {% endif %} 79 {% endif %}
80 80
81 {% set log_activity = world_suffix in method.activity_logging_world_list %} 81 {% if 'scriptState' in function_call %}
82 {% if 'scriptState' in function_call or log_activity %}
83 {% if method.is_static %} 82 {% if method.is_static %}
84 ScriptState* scriptState = ScriptState::forFunctionObject(info); 83 ScriptState* scriptState = ScriptState::forFunctionObject(info);
85 {% else %} 84 {% else %}
86 ScriptState* scriptState = ScriptState::forReceiverObject(info); 85 ScriptState* scriptState = ScriptState::forReceiverObject(info);
87 {% endif %} 86 {% endif %}
88 {% endif %} 87 {% endif %}
89 88
90 {% if log_activity %}
91 V8PerContextData* contextData = scriptState->perContextData();
92 if (contextData && contextData->activityLogger()) {
93 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo ntext, "{{interface_name}}", "{{method.name}}");
94 Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Local<v 8::Value>>>(info, 0, exceptionState);
95 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.name}} ", info.Length(), loggerArgs.data());
96 }
97 {% endif %}
98
99 {% if method.is_custom_element_callbacks %} 89 {% if method.is_custom_element_callbacks %}
100 V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 90 V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
101 {% endif %} 91 {% endif %}
102 92
103 {{function_call | indent(2)}} 93 {{function_call | indent(2)}}
104 } 94 }
105 {% endfilter %} 95 {% endfilter %}
106 {% endmacro %} 96 {% endmacro %}
107 97
108 98
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 {% macro method_callback(method, world_suffix) %} 504 {% macro method_callback(method, world_suffix) %}
515 void {{v8_class_or_partial}}::{{method.name}}MethodCallback{{world_suffix}}(cons t v8::FunctionCallbackInfo<v8::Value>& info) { 505 void {{v8_class_or_partial}}::{{method.name}}MethodCallback{{world_suffix}}(cons t v8::FunctionCallbackInfo<v8::Value>& info) {
516 {% if not method.overloads %}{# Overloaded methods are measured in overload_re solution_method() #} 506 {% if not method.overloads %}{# Overloaded methods are measured in overload_re solution_method() #}
517 {% if method.measure_as %} 507 {% if method.measure_as %}
518 UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{me thod.measure_as('Method')}}); 508 UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{me thod.measure_as('Method')}});
519 {% endif %} 509 {% endif %}
520 {% if method.deprecate_as %} 510 {% if method.deprecate_as %}
521 Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseC ounter::{{method.deprecate_as}}); 511 Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseC ounter::{{method.deprecate_as}});
522 {% endif %} 512 {% endif %}
523 {% endif %}{# not method.overloads #} 513 {% endif %}{# not method.overloads #}
514 {% if world_suffix in method.activity_logging_world_list %}
515 {% if method.is_static %}
516 ScriptState* scriptState = ScriptState::forFunctionObject(info);
517 {% else %}
518 ScriptState* scriptState = ScriptState::forReceiverObject(info);
519 {% endif %}
520 V8PerContextData* contextData = scriptState->perContextData();
521 if (contextData && contextData->activityLogger()) {
522 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo ntext, "{{interface_name}}", "{{method.name}}");
523 Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Local<v 8::Value>>>(info, 0, exceptionState);
524 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.name}} ", info.Length(), loggerArgs.data());
525 }
526 {% endif %}
524 {% if method.is_ce_reactions %} 527 {% if method.is_ce_reactions %}
525 CEReactionsScope ceReactionsScope; 528 CEReactionsScope ceReactionsScope;
526 {% endif %} 529 {% endif %}
527 {% if method.is_custom %} 530 {% if method.is_custom %}
528 {{v8_class}}::{{method.name}}MethodCustom(info); 531 {{v8_class}}::{{method.name}}MethodCustom(info);
529 {% elif method.is_post_message %} 532 {% elif method.is_post_message %}
530 {{cpp_class_or_partial}}V8Internal::postMessageImpl("{{interface_name}}", {{v8 _class}}::toImpl(info.Holder()), info); 533 {{cpp_class_or_partial}}V8Internal::postMessageImpl("{{interface_name}}", {{v8 _class}}::toImpl(info.Holder()), info);
531 {% else %} 534 {% else %}
532 {{cpp_class_or_partial}}V8Internal::{{method.name}}Method{{world_suffix}}(info ); 535 {{cpp_class_or_partial}}V8Internal::{{method.name}}Method{{world_suffix}}(info );
533 {% endif %} 536 {% endif %}
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 if method.overloads else 654 if method.overloads else
652 method.runtime_enabled_feature_name) %} 655 method.runtime_enabled_feature_name) %}
653 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {{method_configuration(method)}}; 656 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {{method_configuration(method)}};
654 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), proto typeObject, interfaceObject, signature, {{method.name}}MethodConfiguration); 657 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), proto typeObject, interfaceObject, signature, {{method.name}}MethodConfiguration);
655 {% endfilter %}{# runtime_enabled() #} 658 {% endfilter %}{# runtime_enabled() #}
656 {% endfilter %}{# exposed() #} 659 {% endfilter %}{# exposed() #}
657 {% endfilter %}{# secure_context() #} 660 {% endfilter %}{# secure_context() #}
658 {% endfor %} 661 {% endfor %}
659 {% endif %} 662 {% endif %}
660 {%- endmacro %} 663 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698