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

Unified Diff: chrome/browser/sync_file_system/drive_backend/metadata_database.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
Index: chrome/browser/sync_file_system/drive_backend/metadata_database.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database.cc b/chrome/browser/sync_file_system/drive_backend/metadata_database.cc
index fd4de8c5ccff273e37f5f101f31c54ba8cf46e1e..85071154e45a7248fea8b40c3553547e0f5ae3f5 100644
--- a/chrome/browser/sync_file_system/drive_backend/metadata_database.cc
+++ b/chrome/browser/sync_file_system/drive_backend/metadata_database.cc
@@ -1612,7 +1612,7 @@ std::unique_ptr<base::ListValue> MetadataDatabase::DumpFiles(
FileKindToString(tracker.synced_details().file_kind()));
}
- base::DictionaryValue* details = new base::DictionaryValue;
+ auto details = base::MakeUnique<base::DictionaryValue>();
details->SetString("file_id", tracker.file_id());
if (tracker.has_synced_details() &&
tracker.synced_details().file_kind() == FILE_KIND_FILE)
@@ -1620,7 +1620,7 @@ std::unique_ptr<base::ListValue> MetadataDatabase::DumpFiles(
details->SetString("active", tracker.active() ? "true" : "false");
details->SetString("dirty", tracker.dirty() ? "true" : "false");
- file->Set("details", details);
+ file->Set("details", std::move(details));
files->Append(std::move(file));
}
@@ -1656,10 +1656,10 @@ std::unique_ptr<base::ListValue> MetadataDatabase::DumpTrackers() {
};
std::vector<std::string> key_strings(
trackerKeys, trackerKeys + arraysize(trackerKeys));
- base::ListValue* keys = new base::ListValue;
+ auto keys = base::MakeUnique<base::ListValue>();
keys->AppendStrings(key_strings);
metadata->SetString("title", "Trackers");
- metadata->Set("keys", keys);
+ metadata->Set("keys", std::move(keys));
trackers->Append(std::move(metadata));
// Append tracker data.
@@ -1718,10 +1718,10 @@ std::unique_ptr<base::ListValue> MetadataDatabase::DumpMetadata() {
};
std::vector<std::string> key_strings(
fileKeys, fileKeys + arraysize(fileKeys));
- base::ListValue* keys = new base::ListValue;
+ auto keys = base::MakeUnique<base::ListValue>();
keys->AppendStrings(key_strings);
metadata->SetString("title", "Metadata");
- metadata->Set("keys", keys);
+ metadata->Set("keys", std::move(keys));
files->Append(std::move(metadata));
// Append metadata data.
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_service_unittest.cc ('k') | chrome/browser/ui/webui/conflicts_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698