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

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

Issue 2911033002: Remove raw base::DictionaryValue::Set (Closed)
Patch Set: Proper Windows Fix Created 3 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
« no previous file with comments | « ipc/ipc_message_unittest.cc ('k') | media/cdm/json_web_key.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3742b5eff001c5216985537f52a76f54b7d7ea3c..f3e25f6f63e337b842ba68633830cfa2075c13e3 100644
--- a/media/cast/logging/stats_event_subscriber.cc
+++ b/media/cast/logging/stats_event_subscriber.cc
@@ -10,6 +10,7 @@
#include "base/format_macros.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
@@ -227,9 +228,9 @@ void StatsEventSubscriber::UpdateFirstLastEventTime(base::TimeTicks timestamp,
std::unique_ptr<base::DictionaryValue> StatsEventSubscriber::GetStats() const {
StatsMap stats_map;
GetStatsInternal(&stats_map);
- std::unique_ptr<base::DictionaryValue> ret(new base::DictionaryValue);
+ auto ret = base::MakeUnique<base::DictionaryValue>();
- std::unique_ptr<base::DictionaryValue> stats(new base::DictionaryValue);
+ auto stats = base::MakeUnique<base::DictionaryValue>();
for (StatsMap::const_iterator it = stats_map.begin(); it != stats_map.end();
++it) {
// Round to 3 digits after the decimal point.
@@ -241,12 +242,11 @@ std::unique_ptr<base::DictionaryValue> StatsEventSubscriber::GetStats() const {
for (HistogramMap::const_iterator it = histograms_.begin();
it != histograms_.end();
++it) {
- stats->Set(CastStatToString(it->first),
- it->second->GetHistogram().release());
+ stats->Set(CastStatToString(it->first), it->second->GetHistogram());
}
ret->Set(event_media_type_ == AUDIO_EVENT ? "audio" : "video",
- stats.release());
+ std::move(stats));
return ret;
}
« no previous file with comments | « ipc/ipc_message_unittest.cc ('k') | media/cdm/json_web_key.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698