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

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

Issue 330293002: Removing unnecessary PerWorldBindings for DOM API calls that are monitored by Activity Logger. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 6 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 {##############################################################################} 1 {##############################################################################}
2 {% macro generate_method(method, world_suffix) %} 2 {% macro generate_method(method, world_suffix) %}
3 {% filter conditional(method.conditional_string) %} 3 {% filter conditional(method.conditional_string) %}
4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) 4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
5 { 5 {
6 {# Local variables #} 6 {# Local variables #}
7 {% if method.has_exception_state %} 7 {% if method.has_exception_state %}
8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); 8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate());
9 {% endif %} 9 {% endif %}
10 {# Overloaded methods have length checked during overload resolution #} 10 {# Overloaded methods have length checked during overload resolution #}
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 396 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
397 {% if not method.overloads %}{# Overloaded methods are measured in overload_ resolution_method() #} 397 {% if not method.overloads %}{# Overloaded methods are measured in overload_ resolution_method() #}
398 {% if method.measure_as %} 398 {% if method.measure_as %}
399 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{ method.measure_as}}); 399 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{ method.measure_as}});
400 {% endif %} 400 {% endif %}
401 {% if method.deprecate_as %} 401 {% if method.deprecate_as %}
402 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use Counter::{{method.deprecate_as}}); 402 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use Counter::{{method.deprecate_as}});
403 {% endif %} 403 {% endif %}
404 {% endif %}{# not method.overloads #} 404 {% endif %}{# not method.overloads #}
405 {% if world_suffix in method.activity_logging_world_list %} 405 {% if world_suffix in method.activity_logging_world_list %}
406 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext()); 406 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo ntext());
407 V8PerContextData* contextData = scriptState->perContextData();
408 {% if method.activity_logging_world_check %}
409 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac tivityLogger())
410 {% else %}
407 if (contextData && contextData->activityLogger()) { 411 if (contextData && contextData->activityLogger()) {
412 {% endif %}
408 {# FIXME: replace toVectorOfArguments with toNativeArguments(info, 0) 413 {# FIXME: replace toVectorOfArguments with toNativeArguments(info, 0)
409 and delete toVectorOfArguments #} 414 and delete toVectorOfArguments #}
410 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle <v8::Value> >(info, 0); 415 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle <v8::Value> >(info, 0);
411 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na me}}", info.Length(), loggerArgs.data()); 416 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na me}}", info.Length(), loggerArgs.data());
412 } 417 }
413 {% endif %} 418 {% endif %}
414 {% if method.is_custom %} 419 {% if method.is_custom %}
415 {{v8_class}}::{{method.name}}MethodCustom(info); 420 {{v8_class}}::{{method.name}}MethodCustom(info);
416 {% else %} 421 {% else %}
417 {{cpp_class}}V8Internal::{{method.name}}Method{{world_suffix}}(info); 422 {{cpp_class}}V8Internal::{{method.name}}Method{{world_suffix}}(info);
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 {% endif %} 561 {% endif %}
557 {{constructor.cpp_type}} impl = {{cpp_class}}::createForJSConstructor({{cons tructor.argument_list | join(', ')}}); 562 {{constructor.cpp_type}} impl = {{cpp_class}}::createForJSConstructor({{cons tructor.argument_list | join(', ')}});
558 {% if is_constructor_raises_exception %} 563 {% if is_constructor_raises_exception %}
559 if (exceptionState.throwIfNeeded()) 564 if (exceptionState.throwIfNeeded())
560 return; 565 return;
561 {% endif %} 566 {% endif %}
562 567
563 {{generate_constructor_wrapper(constructor) | indent}} 568 {{generate_constructor_wrapper(constructor) | indent}}
564 } 569 }
565 {% endmacro %} 570 {% endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/attributes.cpp ('k') | Source/bindings/tests/results/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698