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

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

Issue 1678003002: Remove sampling trace events from the binding layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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_api_experiment %} 1 {% from 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc al_cpp_value, check_api_experiment %}
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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); 492 ExecutionContext* context = currentExecutionContext(info.GetIsolate());
493 instance->postMessage(context, message.release(), ports.get(), exceptionStat e); 493 instance->postMessage(context, message.release(), ports.get(), exceptionStat e);
494 exceptionState.throwIfNeeded(); 494 exceptionState.throwIfNeeded();
495 } 495 }
496 {% endmacro %} 496 {% endmacro %}
497 497
498 {##############################################################################} 498 {##############################################################################}
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 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
503 {% 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() #}
504 {% if method.measure_as %} 503 {% if method.measure_as %}
505 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')}});
506 {% endif %} 505 {% endif %}
507 {% if method.deprecate_as %} 506 {% if method.deprecate_as %}
508 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentExe cutionContext(info.GetIsolate()), UseCounter::{{method.deprecate_as}}); 507 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentExe cutionContext(info.GetIsolate()), UseCounter::{{method.deprecate_as}});
509 {% endif %} 508 {% endif %}
510 {% if method.is_api_experiment_enabled %} 509 {% if method.is_api_experiment_enabled %}
511 {{check_api_experiment(method) | indent}} 510 {{check_api_experiment(method) | indent}}
512 {% endif %} 511 {% endif %}
(...skipping 11 matching lines...) Expand all
524 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na me}}", info.Length(), loggerArgs.data()); 523 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na me}}", info.Length(), loggerArgs.data());
525 } 524 }
526 {% endif %} 525 {% endif %}
527 {% if method.is_custom %} 526 {% if method.is_custom %}
528 {{v8_class}}::{{method.name}}MethodCustom(info); 527 {{v8_class}}::{{method.name}}MethodCustom(info);
529 {% elif method.is_post_message %} 528 {% elif method.is_post_message %}
530 postMessageImpl("{{interface_name}}", {{v8_class}}::toImpl(info.Holder()), i nfo); 529 postMessageImpl("{{interface_name}}", {{v8_class}}::toImpl(info.Holder()), i nfo);
531 {% else %} 530 {% else %}
532 {{cpp_class_or_partial}}V8Internal::{{method.name}}Method{{world_suffix}}(in fo); 531 {{cpp_class_or_partial}}V8Internal::{{method.name}}Method{{world_suffix}}(in fo);
533 {% endif %} 532 {% endif %}
534 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
535 } 533 }
536 {% endmacro %} 534 {% endmacro %}
537 535
538 536
539 {##############################################################################} 537 {##############################################################################}
540 {% macro origin_safe_method_getter(method, world_suffix) %} 538 {% macro origin_safe_method_getter(method, world_suffix) %}
541 static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::Prop ertyCallbackInfo<v8::Value>& info) 539 static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::Prop ertyCallbackInfo<v8::Value>& info)
542 { 540 {
543 {% set signature = 'v8::Local<v8::Signature>()' 541 {% set signature = 'v8::Local<v8::Signature>()'
544 if method.is_do_not_check_signature else 542 if method.is_do_not_check_signature else
(...skipping 21 matching lines...) Expand all
566 if (!hiddenValue.IsEmpty()) { 564 if (!hiddenValue.IsEmpty()) {
567 v8SetReturnValue(info, hiddenValue); 565 v8SetReturnValue(info, hiddenValue);
568 return; 566 return;
569 } 567 }
570 568
571 v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurren tContext()).ToLocalChecked()); 569 v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurren tContext()).ToLocalChecked());
572 } 570 }
573 571
574 static void {{method.name}}OriginSafeMethodGetterCallback{{world_suffix}}(v8::Lo cal<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) 572 static void {{method.name}}OriginSafeMethodGetterCallback{{world_suffix}}(v8::Lo cal<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info)
575 { 573 {
576 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
577 {{cpp_class}}V8Internal::{{method.name}}OriginSafeMethodGetter{{world_suffix }}(info); 574 {{cpp_class}}V8Internal::{{method.name}}OriginSafeMethodGetter{{world_suffix }}(info);
578 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
579 } 575 }
580 {% endmacro %} 576 {% endmacro %}
581 577
582 578
583 {##############################################################################} 579 {##############################################################################}
584 {% macro method_implemented_in_private_script(method) %} 580 {% macro method_implemented_in_private_script(method) %}
585 bool {{v8_class}}::PrivateScript::{{method.name}}Method({{method.argument_declar ations_for_private_script | join(', ')}}) 581 bool {{v8_class}}::PrivateScript::{{method.name}}Method({{method.argument_declar ations_for_private_script | join(', ')}})
586 { 582 {
587 if (!frame) 583 if (!frame)
588 return false; 584 return false;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all 701 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all
706 if method.overloads else 702 if method.overloads else
707 method.runtime_enabled_function) %} 703 method.runtime_enabled_function) %}
708 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {{method_configuration(method)}}; 704 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {{method_configuration(method)}};
709 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prototypeObj ect, interfaceObject, defaultSignature, {{method.name}}MethodConfiguration); 705 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prototypeObj ect, interfaceObject, defaultSignature, {{method.name}}MethodConfiguration);
710 {% endfilter %}{# runtime_enabled() #} 706 {% endfilter %}{# runtime_enabled() #}
711 {% endfilter %}{# exposed() #} 707 {% endfilter %}{# exposed() #}
712 {% endfor %} 708 {% endfor %}
713 {% endif %} 709 {% endif %}
714 {%- endmacro %} 710 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698