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

Unified Diff: base/trace_event/trace_event_system_stats_monitor.cc

Issue 1717283003: tracing: Make ConvertableToTraceFormat move-only scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 10 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
Index: base/trace_event/trace_event_system_stats_monitor.cc
diff --git a/base/trace_event/trace_event_system_stats_monitor.cc b/base/trace_event/trace_event_system_stats_monitor.cc
index 057967bfd90496e46829525ffdcab285ec679f32..d42ad0001f63a1fabf8117e9ed3b9b8634071f6a 100644
--- a/base/trace_event/trace_event_system_stats_monitor.cc
+++ b/base/trace_event/trace_event_system_stats_monitor.cc
@@ -26,6 +26,7 @@ namespace {
class SystemStatsHolder : public base::trace_event::ConvertableToTraceFormat {
public:
SystemStatsHolder() { }
+ ~SystemStatsHolder() override {}
// Fills system_metrics_ with profiled system memory and disk stats.
// Uses the previous stats to compute rates if this is not the first profile.
@@ -37,8 +38,6 @@ class SystemStatsHolder : public base::trace_event::ConvertableToTraceFormat {
}
private:
- ~SystemStatsHolder() override {}
-
SystemMetrics system_stats_;
DISALLOW_COPY_AND_ASSIGN(SystemStatsHolder);
@@ -105,14 +104,13 @@ void TraceEventSystemStatsMonitor::StartProfiling() {
// If system tracing is enabled, dumps a profile to the tracing system.
void TraceEventSystemStatsMonitor::DumpSystemStats() {
- scoped_refptr<SystemStatsHolder> dump_holder = new SystemStatsHolder();
+ scoped_ptr<SystemStatsHolder> dump_holder(new SystemStatsHolder());
dump_holder->GetSystemProfilingStats();
TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(
TRACE_DISABLED_BY_DEFAULT("system_stats"),
- "base::TraceEventSystemStatsMonitor::SystemStats",
- this,
- scoped_refptr<ConvertableToTraceFormat>(dump_holder));
+ "base::TraceEventSystemStatsMonitor::SystemStats", this,
+ std::move(dump_holder));
}
void TraceEventSystemStatsMonitor::StopProfiling() {

Powered by Google App Engine
This is Rietveld 408576698