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

Unified Diff: services/tracing/trace_data_sink.cc

Issue 1065093003: Generate trace header/footer in tracing consumer instead of service (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 | « services/tracing/trace_data_sink.h ('k') | services/tracing/tracing_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/tracing/trace_data_sink.cc
diff --git a/services/tracing/trace_data_sink.cc b/services/tracing/trace_data_sink.cc
index 1abf43ce0f1b69a8424e6c20dd2f3c14f00dbcc2..d1fe93622a8b3a3d48c0b3b3854274d6cde33730 100644
--- a/services/tracing/trace_data_sink.cc
+++ b/services/tracing/trace_data_sink.cc
@@ -10,21 +10,14 @@
using mojo::common::BlockingCopyFromString;
namespace tracing {
-namespace {
-
-const char kStart[] = "{\"traceEvents\":[";
-const char kEnd[] = "]}";
-
-} // namespace
TraceDataSink::TraceDataSink(mojo::ScopedDataPipeProducerHandle pipe)
: pipe_(pipe.Pass()), empty_(true) {
- BlockingCopyFromString(kStart, pipe_);
}
TraceDataSink::~TraceDataSink() {
if (pipe_.is_valid())
- Flush();
+ pipe_.reset();
DCHECK(!pipe_.is_valid());
}
@@ -35,9 +28,4 @@ void TraceDataSink::AddChunk(const std::string& json) {
BlockingCopyFromString(json, pipe_);
}
-void TraceDataSink::Flush() {
- BlockingCopyFromString(kEnd, pipe_);
- pipe_.reset();
-}
-
} // namespace tracing
« no previous file with comments | « services/tracing/trace_data_sink.h ('k') | services/tracing/tracing_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698