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

Unified Diff: chromecast/base/metrics/cast_metrics_helper.cc

Issue 1875623002: Convert //chromecast from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « chromecast/base/error_codes_unittest.cc ('k') | chromecast/base/serializers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/base/metrics/cast_metrics_helper.cc
diff --git a/chromecast/base/metrics/cast_metrics_helper.cc b/chromecast/base/metrics/cast_metrics_helper.cc
index 6a5a02d9c0c486da22ed34a9263be258437da489..ac8b7b8f1f2a13511590d4085255ca7c90a3953d 100644
--- a/chromecast/base/metrics/cast_metrics_helper.cc
+++ b/chromecast/base/metrics/cast_metrics_helper.cc
@@ -4,6 +4,7 @@
#include "chromecast/base/metrics/cast_metrics_helper.h"
+#include <memory>
#include <string>
#include <vector>
@@ -11,7 +12,6 @@
#include "base/bind_helpers.h"
#include "base/json/json_string_value_serializer.h"
#include "base/location.h"
-#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram.h"
#include "base/metrics/user_metrics.h"
#include "base/single_thread_task_runner.h"
@@ -40,8 +40,8 @@ CastMetricsHelper* g_instance = NULL;
const char kMetricsNameAppInfoDelimiter = '#';
-scoped_ptr<std::string> SerializeToJson(const base::Value& value) {
- scoped_ptr<std::string> json_str(new std::string());
+std::unique_ptr<std::string> SerializeToJson(const base::Value& value) {
+ std::unique_ptr<std::string> json_str(new std::string());
JSONStringValueSerializer serializer(json_str.get());
if (!serializer.Serialize(value))
json_str.reset(nullptr);
@@ -292,7 +292,8 @@ void CastMetricsHelper::LogMediumTimeHistogramEvent(
}
void CastMetricsHelper::RecordApplicationEvent(const std::string& event) {
- scoped_ptr<base::DictionaryValue> cast_event(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> cast_event(
+ new base::DictionaryValue());
cast_event->SetString("name", event);
base::TimeTicks now = base::TimeTicks::Now();
cast_event->SetDouble("time", now.ToInternalValue());
@@ -306,7 +307,8 @@ void CastMetricsHelper::RecordApplicationEvent(const std::string& event) {
void CastMetricsHelper::RecordApplicationEventWithValue(
const std::string& event,
int value) {
- scoped_ptr<base::DictionaryValue> cast_event(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> cast_event(
+ new base::DictionaryValue());
cast_event->SetString("name", event);
base::TimeTicks now = base::TimeTicks::Now();
cast_event->SetDouble("time", now.ToInternalValue());
« no previous file with comments | « chromecast/base/error_codes_unittest.cc ('k') | chromecast/base/serializers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698