Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 %} |
| OLD | NEW |