diff options
author | Eugene Ostroukhov <eostroukhov@google.com> | 2018-05-16 09:43:17 -0700 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2018-06-01 09:59:11 +0200 |
commit | 1fb0b2cb92bdfb0b73cd4d333436794775d4630d (patch) | |
tree | 80b1e74261f9789dcbedb191e1acf5a3cd68bd5f /deps/v8/src/libplatform | |
parent | ff06cdba1b9d496b14d621f5f60dd84ae522b699 (diff) | |
download | node-new-1fb0b2cb92bdfb0b73cd4d333436794775d4630d.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.cc | 13 | ||||
-rw-r--r-- | deps/v8/src/libplatform/tracing/trace-writer.h | 1 |
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; |