| Index: content/browser/tracing/tracing_controller_impl_data_sinks.cc
|
| diff --git a/content/browser/tracing/tracing_controller_impl_data_sinks.cc b/content/browser/tracing/tracing_controller_impl_data_sinks.cc
|
| index 73cb23886714d839277b9a7649fedab654180d35..dcbe8db1d229efcd92087db51fa30e71097d5872 100644
|
| --- a/content/browser/tracing/tracing_controller_impl_data_sinks.cc
|
| +++ b/content/browser/tracing/tracing_controller_impl_data_sinks.cc
|
| @@ -17,9 +17,6 @@ namespace content {
|
|
|
| namespace {
|
|
|
| -const char kChromeTraceLabel[] = "traceEvents";
|
| -const char kMetadataTraceLabel[] = "metadata";
|
| -
|
| class StringTraceDataEndpoint : public TraceDataEndpoint {
|
| public:
|
| typedef base::Callback<void(std::unique_ptr<const base::DictionaryValue>,
|
| @@ -143,37 +140,14 @@ class TraceDataSinkImplBase : public TracingController::TraceDataSink {
|
| class JSONTraceDataSink : public TraceDataSinkImplBase {
|
| public:
|
| explicit JSONTraceDataSink(scoped_refptr<TraceDataEndpoint> endpoint)
|
| - : endpoint_(endpoint), had_received_first_chunk_(false) {}
|
| + : endpoint_(endpoint) {}
|
|
|
| void AddTraceChunk(const std::string& chunk) override {
|
| - std::string trace_string;
|
| - if (had_received_first_chunk_)
|
| - trace_string = ",";
|
| - else
|
| - trace_string = "{\"" + std::string(kChromeTraceLabel) + "\":[";
|
| - trace_string += chunk;
|
| - had_received_first_chunk_ = true;
|
| -
|
| - endpoint_->ReceiveTraceChunk(base::MakeUnique<std::string>(trace_string));
|
| + endpoint_->ReceiveTraceChunk(base::MakeUnique<std::string>(chunk));
|
| }
|
|
|
| void Close() override {
|
| - endpoint_->ReceiveTraceChunk(base::MakeUnique<std::string>("]"));
|
| -
|
| - for (auto const &it : GetAgentTrace())
|
| - endpoint_->ReceiveTraceChunk(
|
| - base::MakeUnique<std::string>(",\"" + it.first + "\": " + it.second));
|
| -
|
| std::unique_ptr<base::DictionaryValue> metadata(TakeMetadata());
|
| - std::string metadataJSON;
|
| -
|
| - if (base::JSONWriter::Write(*metadata, &metadataJSON) &&
|
| - !metadataJSON.empty()) {
|
| - endpoint_->ReceiveTraceChunk(base::MakeUnique<std::string>(
|
| - ",\"" + std::string(kMetadataTraceLabel) + "\": " + metadataJSON));
|
| - }
|
| -
|
| - endpoint_->ReceiveTraceChunk(base::MakeUnique<std::string>("}"));
|
| endpoint_->ReceiveTraceFinalContents(std::move(metadata));
|
| }
|
|
|
| @@ -181,7 +155,6 @@ class JSONTraceDataSink : public TraceDataSinkImplBase {
|
| ~JSONTraceDataSink() override {}
|
|
|
| scoped_refptr<TraceDataEndpoint> endpoint_;
|
| - bool had_received_first_chunk_;
|
| DISALLOW_COPY_AND_ASSIGN(JSONTraceDataSink);
|
| };
|
|
|
|
|