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/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 const std::string& json_trace_output) { | 291 const std::string& json_trace_output) { |
292 json_output += json_trace_output; | 292 json_output += json_trace_output; |
293 } | 293 } |
294 | 294 |
295 TraceResultBuffer::TraceResultBuffer() : append_comma_(false) { | 295 TraceResultBuffer::TraceResultBuffer() : append_comma_(false) { |
296 } | 296 } |
297 | 297 |
298 TraceResultBuffer::~TraceResultBuffer() { | 298 TraceResultBuffer::~TraceResultBuffer() { |
299 } | 299 } |
300 | 300 |
301 void TraceResultBuffer::SetOutputCallback(OutputCallback json_chunk_callback) { | 301 void TraceResultBuffer::SetOutputCallback( |
| 302 const OutputCallback& json_chunk_callback) { |
302 output_callback_ = json_chunk_callback; | 303 output_callback_ = json_chunk_callback; |
303 } | 304 } |
304 | 305 |
305 void TraceResultBuffer::Start() { | 306 void TraceResultBuffer::Start() { |
306 append_comma_ = false; | 307 append_comma_ = false; |
307 output_callback_.Run("["); | 308 output_callback_.Run("["); |
308 } | 309 } |
309 | 310 |
310 void TraceResultBuffer::AddFragment(const std::string& trace_fragment) { | 311 void TraceResultBuffer::AddFragment(const std::string& trace_fragment) { |
311 if (append_comma_) | 312 if (append_comma_) |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 kNoArgName, kNoArgValue, kNoArgName, kNoArgValue, | 764 kNoArgName, kNoArgValue, kNoArgName, kNoArgValue, |
764 p_data_->threshold_begin_id, p_data_->threshold, | 765 p_data_->threshold_begin_id, p_data_->threshold, |
765 TRACE_EVENT_FLAG_NONE); | 766 TRACE_EVENT_FLAG_NONE); |
766 } | 767 } |
767 } | 768 } |
768 | 769 |
769 } // namespace internal | 770 } // namespace internal |
770 | 771 |
771 } // namespace debug | 772 } // namespace debug |
772 } // namespace base | 773 } // namespace base |
OLD | NEW |