Index: gin/v8_platform.cc |
diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc |
index 15fb9f54ecf0fc3b576a83efe45c803dc2d7184c..51a096ccea3449842c23097fd84c33b9f9575d0d 100644 |
--- a/gin/v8_platform.cc |
+++ b/gin/v8_platform.cc |
@@ -97,11 +97,22 @@ uint64_t V8Platform::AddTraceEvent(char phase, |
const uint8_t* arg_types, |
const uint64_t* arg_values, |
unsigned int flags) { |
+ std::unique_ptr<base::trace_event::ConvertableToTraceFormat> convertables[2]; |
fmeawad
2016/09/15 23:53:44
Instead of the 2 if conditions, maybe a tiny for l
alph
2016/09/15 23:58:14
I doubt it will be able to unroll it as the num_ar
|
+ if (num_args > 0 && arg_types[0] == TRACE_VALUE_TYPE_CONVERTABLE) { |
+ convertables[0].reset( |
+ reinterpret_cast<base::trace_event::ConvertableToTraceFormat*>( |
+ arg_values[0])); |
+ } |
+ if (num_args > 1 && arg_types[1] == TRACE_VALUE_TYPE_CONVERTABLE) { |
+ convertables[1].reset( |
+ reinterpret_cast<base::trace_event::ConvertableToTraceFormat*>( |
+ arg_values[1])); |
+ } |
base::trace_event::TraceEventHandle handle = |
TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_BIND_ID( |
phase, category_enabled_flag, name, scope, id, bind_id, num_args, |
- arg_names, arg_types, (const long long unsigned int*)arg_values, NULL, |
- flags); |
+ arg_names, arg_types, (const long long unsigned int*)arg_values, |
+ convertables, flags); |
uint64_t result; |
memcpy(&result, &handle, sizeof(result)); |
return result; |