OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/debug/trace_event.h" | 5 #include "base/debug/trace_event.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 const std::string& json_trace_output) { | 289 const std::string& json_trace_output) { |
290 json_output += json_trace_output; | 290 json_output += json_trace_output; |
291 } | 291 } |
292 | 292 |
293 TraceResultBuffer::TraceResultBuffer() : append_comma_(false) { | 293 TraceResultBuffer::TraceResultBuffer() : append_comma_(false) { |
294 } | 294 } |
295 | 295 |
296 TraceResultBuffer::~TraceResultBuffer() { | 296 TraceResultBuffer::~TraceResultBuffer() { |
297 } | 297 } |
298 | 298 |
299 void TraceResultBuffer::SetOutputCallback(OutputCallback json_chunk_callback) { | 299 void TraceResultBuffer::SetOutputCallback( |
| 300 const OutputCallback& json_chunk_callback) { |
300 output_callback_ = json_chunk_callback; | 301 output_callback_ = json_chunk_callback; |
301 } | 302 } |
302 | 303 |
303 void TraceResultBuffer::Start() { | 304 void TraceResultBuffer::Start() { |
304 append_comma_ = false; | 305 append_comma_ = false; |
305 output_callback_.Run("["); | 306 output_callback_.Run("["); |
306 } | 307 } |
307 | 308 |
308 void TraceResultBuffer::AddFragment(const std::string& trace_fragment) { | 309 void TraceResultBuffer::AddFragment(const std::string& trace_fragment) { |
309 if (append_comma_) | 310 if (append_comma_) |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 kNoArgName, kNoArgValue, kNoArgName, kNoArgValue, | 720 kNoArgName, kNoArgValue, kNoArgName, kNoArgValue, |
720 p_data_->threshold_begin_id, p_data_->threshold, | 721 p_data_->threshold_begin_id, p_data_->threshold, |
721 TRACE_EVENT_FLAG_NONE); | 722 TRACE_EVENT_FLAG_NONE); |
722 } | 723 } |
723 } | 724 } |
724 | 725 |
725 } // namespace internal | 726 } // namespace internal |
726 | 727 |
727 } // namespace debug | 728 } // namespace debug |
728 } // namespace base | 729 } // namespace base |
OLD | NEW |