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

Unified Diff: media/cast/logging/stats_event_subscriber.cc

Issue 2051663003: base::ListValue::Append cleanup: pass unique_ptr instead of the released pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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: media/cast/logging/stats_event_subscriber.cc
diff --git a/media/cast/logging/stats_event_subscriber.cc b/media/cast/logging/stats_event_subscriber.cc
index 8afefbb81f20237ae6ddbf9fb427252e54f83cc3..3742b5eff001c5216985537f52a76f54b7d7ea3c 100644
--- a/media/cast/logging/stats_event_subscriber.cc
+++ b/media/cast/logging/stats_event_subscriber.cc
@@ -6,6 +6,7 @@
#include <algorithm>
#include <cmath>
+#include <utility>
#include "base/format_macros.h"
#include "base/logging.h"
@@ -71,7 +72,7 @@ StatsEventSubscriber::SimpleHistogram::GetHistogram() const {
if (buckets_.front()) {
bucket->SetInteger(base::StringPrintf("<%" PRId64, min_),
buckets_.front());
- histo->Append(bucket.release());
+ histo->Append(std::move(bucket));
}
for (size_t i = 1; i < buckets_.size() - 1; i++) {
@@ -83,14 +84,14 @@ StatsEventSubscriber::SimpleHistogram::GetHistogram() const {
bucket->SetInteger(
base::StringPrintf("%" PRId64 "-%" PRId64, lower, upper),
buckets_[i]);
- histo->Append(bucket.release());
+ histo->Append(std::move(bucket));
}
if (buckets_.back()) {
bucket.reset(new base::DictionaryValue);
bucket->SetInteger(base::StringPrintf(">=%" PRId64, max_),
buckets_.back());
- histo->Append(bucket.release());
+ histo->Append(std::move(bucket));
}
return histo;
}

Powered by Google App Engine
This is Rietveld 408576698