Index: rlz/chromeos/lib/rlz_value_store_chromeos.cc |
diff --git a/rlz/chromeos/lib/rlz_value_store_chromeos.cc b/rlz/chromeos/lib/rlz_value_store_chromeos.cc |
index 9f07b75a669e304d2cc03456835a54dbf0e81ed2..84167aa6a08c0cfd5cae6d8d51d763f2d57e1252 100644 |
--- a/rlz/chromeos/lib/rlz_value_store_chromeos.cc |
+++ b/rlz/chromeos/lib/rlz_value_store_chromeos.cc |
@@ -10,6 +10,7 @@ |
#include "base/json/json_file_value_serializer.h" |
#include "base/json/json_string_value_serializer.h" |
#include "base/logging.h" |
+#include "base/memory/ptr_util.h" |
#include "base/path_service.h" |
#include "base/sequenced_task_runner.h" |
#include "base/strings/string_number_conversions.h" |
@@ -147,7 +148,7 @@ bool RlzValueStoreChromeOS::AddProductEvent(Product product, |
const char* event_rlz) { |
DCHECK(CalledOnValidThread()); |
return AddValueToList(GetKeyName(kProductEventKey, product), |
- new base::StringValue(event_rlz)); |
+ base::MakeUnique<base::StringValue>(event_rlz)); |
} |
bool RlzValueStoreChromeOS::ReadProductEvents( |
@@ -184,7 +185,7 @@ bool RlzValueStoreChromeOS::AddStatefulEvent(Product product, |
const char* event_rlz) { |
DCHECK(CalledOnValidThread()); |
return AddValueToList(GetKeyName(kStatefulEventKey, product), |
- new base::StringValue(event_rlz)); |
+ base::MakeUnique<base::StringValue>(event_rlz)); |
} |
bool RlzValueStoreChromeOS::IsStatefulEvent(Product product, |
@@ -243,13 +244,13 @@ void RlzValueStoreChromeOS::WriteStore() { |
} |
bool RlzValueStoreChromeOS::AddValueToList(const std::string& list_name, |
- base::Value* value) { |
+ std::unique_ptr<base::Value> value) { |
base::ListValue* list_value = NULL; |
if (!rlz_store_->GetList(list_name, &list_value)) { |
list_value = new base::ListValue; |
rlz_store_->Set(list_name, list_value); |
} |
- list_value->AppendIfNotPresent(value); |
+ list_value->AppendIfNotPresent(std::move(value)); |
return true; |
} |