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

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

Issue 1861433002: Make [OriginTrialEnabled] and [RuntimeEnabled] mutually exclusive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@586594-separate-tests
Patch Set: Correct IDL for Web Bluetooth Created 4 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 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc al_cpp_value, check_origin_trial %} 1 {% from 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc al_cpp_value, check_origin_trial %}
2 2
3 {##############################################################################} 3 {##############################################################################}
4 {% macro generate_method(method, world_suffix) %} 4 {% macro generate_method(method, world_suffix) %}
5 {% if method.returns_promise and method.has_exception_state %} 5 {% if method.returns_promise and method.has_exception_state %}
6 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e) 6 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e)
7 {% else %} 7 {% else %}
8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) 8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
9 {% endif %} 9 {% endif %}
10 { 10 {
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 {% macro method_callback(method, world_suffix) %} 499 {% macro method_callback(method, world_suffix) %}
500 static void {{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCall backInfo<v8::Value>& info) 500 static void {{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCall backInfo<v8::Value>& info)
501 { 501 {
502 {% if not method.overloads %}{# Overloaded methods are measured in overload_ resolution_method() #} 502 {% if not method.overloads %}{# Overloaded methods are measured in overload_ resolution_method() #}
503 {% if method.measure_as %} 503 {% if method.measure_as %}
504 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte xt(info.GetIsolate()), UseCounter::{{method.measure_as('Method')}}); 504 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte xt(info.GetIsolate()), UseCounter::{{method.measure_as('Method')}});
505 {% endif %} 505 {% endif %}
506 {% if method.deprecate_as %} 506 {% if method.deprecate_as %}
507 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentEx ecutionContext(info.GetIsolate()), UseCounter::{{method.deprecate_as}}); 507 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentEx ecutionContext(info.GetIsolate()), UseCounter::{{method.deprecate_as}});
508 {% endif %} 508 {% endif %}
509 {% if method.is_origin_trial_enabled %} 509 {% if method.origin_trial_enabled_function %}
510 {{check_origin_trial(method) | indent}} 510 {{check_origin_trial(method) | indent}}
511 {% endif %} 511 {% endif %}
512 {% endif %}{# not method.overloads #} 512 {% endif %}{# not method.overloads #}
513 {% if world_suffix in method.activity_logging_world_list %} 513 {% if world_suffix in method.activity_logging_world_list %}
514 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo ntext()); 514 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo ntext());
515 V8PerContextData* contextData = scriptState->perContextData(); 515 V8PerContextData* contextData = scriptState->perContextData();
516 {% if method.activity_logging_world_check %} 516 {% if method.activity_logging_world_check %}
517 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac tivityLogger()) 517 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac tivityLogger())
518 {% else %} 518 {% else %}
519 if (contextData && contextData->activityLogger()) { 519 if (contextData && contextData->activityLogger()) {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all 698 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all
699 if method.overloads else 699 if method.overloads else
700 method.runtime_enabled_function) %} 700 method.runtime_enabled_function) %}
701 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {{method_configuration(method)}}; 701 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {{method_configuration(method)}};
702 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prototypeObj ect, interfaceObject, signature, {{method.name}}MethodConfiguration); 702 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prototypeObj ect, interfaceObject, signature, {{method.name}}MethodConfiguration);
703 {% endfilter %}{# runtime_enabled() #} 703 {% endfilter %}{# runtime_enabled() #}
704 {% endfilter %}{# exposed() #} 704 {% endfilter %}{# exposed() #}
705 {% endfor %} 705 {% endfor %}
706 {% endif %} 706 {% endif %}
707 {%- endmacro %} 707 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698