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

Unified Diff: src/libplatform/tracing/trace-writer.cc

Issue 2367603002: [tracing] Support ConvertableToTraceFormat argument type. (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
Index: src/libplatform/tracing/trace-writer.cc
diff --git a/src/libplatform/tracing/trace-writer.cc b/src/libplatform/tracing/trace-writer.cc
index ec95527d5f6a892e4cc9437b5f526af471219830..4d08c967df2091a122fd79728ab6fe786a7b36e7 100644
--- a/src/libplatform/tracing/trace-writer.cc
+++ b/src/libplatform/tracing/trace-writer.cc
@@ -7,6 +7,7 @@
#include <cmath>
#include "base/trace_event/common/trace_event_common.h"
+#include "include/v8-platform.h"
#include "src/base/platform/platform.h"
namespace v8 {
@@ -106,6 +107,15 @@ void JSONTraceWriter::AppendArgValue(uint8_t type,
WriteJSONStringToStream(value.as_string, stream_);
}
break;
+ case TRACE_VALUE_TYPE_CONVERTABLE: {
+ std::unique_ptr<v8::ConvertableToTraceFormat> convertable_arg(
+ reinterpret_cast<v8::ConvertableToTraceFormat*>(
+ static_cast<intptr_t>(value.as_uint)));
+ std::string arg_stringified;
+ convertable_arg->AppendAsTraceFormat(&arg_stringified);
+ stream_ << arg_stringified;
+ break;
+ }
default:
UNREACHABLE();
break;
« no previous file with comments | « include/v8-platform.h ('k') | src/tracing/trace-event.h » ('j') | src/tracing/trace-event.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698