| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/trace_event/trace_event_system_stats_monitor.h" | 5 #include "base/trace_event/trace_event_system_stats_monitor.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/debug/leak_annotations.h" | 9 #include "base/debug/leak_annotations.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/thread_task_runner_handle.h" | |
| 17 #include "base/threading/thread_local_storage.h" | 16 #include "base/threading/thread_local_storage.h" |
| 17 #include "base/threading/thread_task_runner_handle.h" |
| 18 #include "base/trace_event/trace_event.h" | 18 #include "base/trace_event/trace_event.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 namespace trace_event { | 21 namespace trace_event { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 ///////////////////////////////////////////////////////////////////////////// | 25 ///////////////////////////////////////////////////////////////////////////// |
| 26 // Holds profiled system stats until the tracing system needs to serialize it. | 26 // Holds profiled system stats until the tracing system needs to serialize it. |
| 27 class SystemStatsHolder : public base::trace_event::ConvertableToTraceFormat { | 27 class SystemStatsHolder : public base::trace_event::ConvertableToTraceFormat { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 void AppendSystemProfileAsTraceFormat(const SystemMetrics& system_metrics, | 125 void AppendSystemProfileAsTraceFormat(const SystemMetrics& system_metrics, |
| 126 std::string* output) { | 126 std::string* output) { |
| 127 std::string tmp; | 127 std::string tmp; |
| 128 base::JSONWriter::Write(*system_metrics.ToValue(), &tmp); | 128 base::JSONWriter::Write(*system_metrics.ToValue(), &tmp); |
| 129 *output += tmp; | 129 *output += tmp; |
| 130 } | 130 } |
| 131 | 131 |
| 132 } // namespace trace_event | 132 } // namespace trace_event |
| 133 } // namespace base | 133 } // namespace base |
| OLD | NEW |