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

Unified Diff: gin/v8_platform.cc

Issue 2347033002: [gin] Support ConvertableToTraceFormat arguments for events coming from V8. (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698