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

Unified Diff: tools/json_schema_compiler/util.cc

Issue 1869503004: Convert //tools to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, change iwyu fixes for converted directories to include <memory> 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 | « tools/json_schema_compiler/util.h ('k') | tools/json_schema_compiler/util_cc_helper.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/util.cc
diff --git a/tools/json_schema_compiler/util.cc b/tools/json_schema_compiler/util.cc
index c7fc4338bfb8cefe13de8ee3163faebb2e9612c7..dcb44ecb1323accbc16cc370ccbabb7c48f1379e 100644
--- a/tools/json_schema_compiler/util.cc
+++ b/tools/json_schema_compiler/util.cc
@@ -100,29 +100,29 @@ bool PopulateItem(const base::Value& from,
return true;
}
-bool PopulateItem(const base::Value& from, scoped_ptr<base::Value>* out) {
- *out = make_scoped_ptr(from.DeepCopy());
+bool PopulateItem(const base::Value& from, std::unique_ptr<base::Value>* out) {
+ *out = from.CreateDeepCopy();
return true;
}
bool PopulateItem(const base::Value& from,
- scoped_ptr<base::Value>* out,
+ std::unique_ptr<base::Value>* out,
base::string16* error) {
- *out = make_scoped_ptr(from.DeepCopy());
+ *out = from.CreateDeepCopy();
return true;
}
bool PopulateItem(const base::Value& from,
- scoped_ptr<base::DictionaryValue>* out) {
+ std::unique_ptr<base::DictionaryValue>* out) {
const base::DictionaryValue* dict = nullptr;
if (!from.GetAsDictionary(&dict))
return false;
- *out = make_scoped_ptr(dict->DeepCopy());
+ *out = dict->CreateDeepCopy();
return true;
}
bool PopulateItem(const base::Value& from,
- scoped_ptr<base::DictionaryValue>* out,
+ std::unique_ptr<base::DictionaryValue>* out,
base::string16* error) {
const base::DictionaryValue* dict = nullptr;
if (!from.GetAsDictionary(&dict)) {
@@ -133,7 +133,7 @@ bool PopulateItem(const base::Value& from,
ValueTypeToString(from.GetType())));
return false;
}
- *out = make_scoped_ptr(dict->DeepCopy());
+ *out = dict->CreateDeepCopy();
return true;
}
@@ -158,11 +158,12 @@ void AddItemToList(const std::vector<char>& from, base::ListValue* out) {
base::BinaryValue::CreateWithCopiedBuffer(from.data(), from.size()));
}
-void AddItemToList(const scoped_ptr<base::Value>& from, base::ListValue* out) {
+void AddItemToList(const std::unique_ptr<base::Value>& from,
+ base::ListValue* out) {
out->Append(from->DeepCopy());
}
-void AddItemToList(const scoped_ptr<base::DictionaryValue>& from,
+void AddItemToList(const std::unique_ptr<base::DictionaryValue>& from,
base::ListValue* out) {
out->Append(static_cast<base::Value*>(from->DeepCopy()));
}
« no previous file with comments | « tools/json_schema_compiler/util.h ('k') | tools/json_schema_compiler/util_cc_helper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698