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

Unified Diff: components/sync/syncable/model_type.cc

Issue 2889163002: Remove raw DictionaryValue::Set in //components (Closed)
Patch Set: Nits Created 3 years, 7 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 | « components/sync/syncable/entry_kernel.cc ('k') | components/sync/syncable/model_type_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/syncable/model_type.cc
diff --git a/components/sync/syncable/model_type.cc b/components/sync/syncable/model_type.cc
index e1f4d49d127d3afc456ce0b151094b3d16c65c8c..20094c7b9ac6c0a0802a1a2c901c385c59346338 100644
--- a/components/sync/syncable/model_type.cc
+++ b/components/sync/syncable/model_type.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_split.h"
#include "base/values.h"
#include "components/reading_list/core/reading_list_enable_flags.h"
@@ -562,16 +563,16 @@ int ModelTypeToHistogramInt(ModelType model_type) {
return 0;
}
-base::Value* ModelTypeToValue(ModelType model_type) {
+std::unique_ptr<base::Value> ModelTypeToValue(ModelType model_type) {
if (model_type >= FIRST_REAL_MODEL_TYPE) {
- return new base::Value(ModelTypeToString(model_type));
+ return base::MakeUnique<base::Value>(ModelTypeToString(model_type));
} else if (model_type == TOP_LEVEL_FOLDER) {
- return new base::Value("Top-level folder");
+ return base::MakeUnique<base::Value>("Top-level folder");
} else if (model_type == UNSPECIFIED) {
- return new base::Value("Unspecified");
+ return base::MakeUnique<base::Value>("Unspecified");
}
NOTREACHED();
- return new base::Value(std::string());
+ return base::MakeUnique<base::Value>(std::string());
}
ModelType ModelTypeFromValue(const base::Value& value) {
« no previous file with comments | « components/sync/syncable/entry_kernel.cc ('k') | components/sync/syncable/model_type_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698