summaryrefslogtreecommitdiff
path: root/deps/v8/src/libplatform
diff options
context:
space:
mode:
authorEugene Ostroukhov <eostroukhov@google.com>2018-05-16 09:43:17 -0700
committerEugene Ostroukhov <eostroukhov@google.com>2018-05-17 13:14:26 -0700
commit5248401174ff1ec02f5e1a247a97594341bbfd89 (patch)
tree16a728ae9e136aad7df2a0454107f9395d42dd5e /deps/v8/src/libplatform
parentc7831bb206e13d99e91b9e90c15a796c3bf134f6 (diff)
downloadnode-new-5248401174ff1ec02f5e1a247a97594341bbfd89.tar.gz
deps: cherry-pick 23652c5f from upstream V8
Original commit message: Custom tag for the traceEvents array This API will be used by Node.js to provide output compatible with Chrome devtools. Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng Change-Id: I265495f8af39bfc78d7fdbe43ac308f0920e817d Reviewed-on: https://chromium-review.googlesource.com/1044491 Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Commit-Queue: Eugene Ostroukhov <eostroukhov@chromium.org> Cr-Commit-Position: refs/heads/master@{#53041} PR-URL: https://github.com/nodejs/node/pull/20608 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'deps/v8/src/libplatform')
-rw-r--r--deps/v8/src/libplatform/tracing/trace-writer.cc13
-rw-r--r--deps/v8/src/libplatform/tracing/trace-writer.h1
2 files changed, 12 insertions, 2 deletions
diff --git a/deps/v8/src/libplatform/tracing/trace-writer.cc b/deps/v8/src/libplatform/tracing/trace-writer.cc
index 36a8783499..7bfc766469 100644
--- a/deps/v8/src/libplatform/tracing/trace-writer.cc
+++ b/deps/v8/src/libplatform/tracing/trace-writer.cc
@@ -119,8 +119,12 @@ void JSONTraceWriter::AppendArgValue(ConvertableToTraceFormat* value) {
stream_ << arg_stringified;
}
-JSONTraceWriter::JSONTraceWriter(std::ostream& stream) : stream_(stream) {
- stream_ << "{\"traceEvents\":[";
+JSONTraceWriter::JSONTraceWriter(std::ostream& stream)
+ : JSONTraceWriter(stream, "traceEvents") {}
+
+JSONTraceWriter::JSONTraceWriter(std::ostream& stream, const std::string& tag)
+ : stream_(stream) {
+ stream_ << "{\"" << tag << "\":[";
}
JSONTraceWriter::~JSONTraceWriter() { stream_ << "]}"; }
@@ -171,6 +175,11 @@ TraceWriter* TraceWriter::CreateJSONTraceWriter(std::ostream& stream) {
return new JSONTraceWriter(stream);
}
+TraceWriter* TraceWriter::CreateJSONTraceWriter(std::ostream& stream,
+ const std::string& tag) {
+ return new JSONTraceWriter(stream, tag);
+}
+
} // namespace tracing
} // namespace platform
} // namespace v8
diff --git a/deps/v8/src/libplatform/tracing/trace-writer.h b/deps/v8/src/libplatform/tracing/trace-writer.h
index 7e1bdc24d6..d811351389 100644
--- a/deps/v8/src/libplatform/tracing/trace-writer.h
+++ b/deps/v8/src/libplatform/tracing/trace-writer.h
@@ -14,6 +14,7 @@ namespace tracing {
class JSONTraceWriter : public TraceWriter {
public:
explicit JSONTraceWriter(std::ostream& stream);
+ JSONTraceWriter(std::ostream& stream, const std::string& tag);
~JSONTraceWriter();
void AppendTraceEvent(TraceObject* trace_event) override;
void Flush() override;