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

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

Issue 58963002: IDL compiler: [ActivityLogging] for methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 {##############################################################################} 1 {##############################################################################}
2 {% macro generate_method(method) %} 2 {% macro generate_method(method) %}
3 static void {{method.name}}Method(const v8::FunctionCallbackInfo<v8::Value>& inf o) 3 static void {{method.name}}Method(const v8::FunctionCallbackInfo<v8::Value>& inf o)
4 { 4 {
5 {% if method.number_of_required_arguments %} 5 {% if method.number_of_required_arguments %}
6 if (UNLIKELY(info.Length() < {{method.number_of_required_arguments}})) { 6 if (UNLIKELY(info.Length() < {{method.number_of_required_arguments}})) {
7 throwTypeError(ExceptionMessages::failedToExecute("{{method.name}}", "{{ interface_name}}", ExceptionMessages::notEnoughArguments({{method.number_of_requ ired_arguments}}, info.Length())), info.GetIsolate()); 7 throwTypeError(ExceptionMessages::failedToExecute("{{method.name}}", "{{ interface_name}}", ExceptionMessages::notEnoughArguments({{method.number_of_requ ired_arguments}}, info.Length())), info.GetIsolate());
8 return; 8 return;
9 } 9 }
10 {% endif %} 10 {% endif %}
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 return; 61 return;
62 } 62 }
63 {% endif %} 63 {% endif %}
64 {% endfor %} 64 {% endfor %}
65 {{method.cpp_method}}; 65 {{method.cpp_method}};
66 } 66 }
67 {% endmacro %} 67 {% endmacro %}
68 68
69 69
70 {##############################################################################} 70 {##############################################################################}
71 {% macro method_callback(method) %} 71 {% macro method_callback(method, world_suffix) %}
72 static void {{method.name}}MethodCallback(const v8::FunctionCallbackInfo<v8::Val ue>& info) 72 static void {{method.name}}MethodCallback(const v8::FunctionCallbackInfo<v8::Val ue>& info)
73 { 73 {
74 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 74 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
75 {% if world_suffix in method.activity_logging_world_list %}
76 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext());
77 if (contextData && contextData->activityLogger()) {
78 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info);
haraken 2013/11/05 06:27:37 Shall we use toNativeArguments(info, 0), and then
Nils Barth (inactive) 2013/11/05 06:40:57 Sounds good; will do in a followup!
79 contextData->activityLogger()->log("{{interface_name}}.{{method.name}}", info.Length(), loggerArgs.data(), "Method");
80 }
81 {% endif %}
75 {{cpp_class_name}}V8Internal::{{method.name}}Method(info); 82 {{cpp_class_name}}V8Internal::{{method.name}}Method(info);
76 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 83 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
77 } 84 }
78 {% endmacro %} 85 {% endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698