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

Unified Diff: chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc

Issue 2323993004: Remove use of deprecated base::ListValue::Append(Value*) overload in extensions. (Closed)
Patch Set: ... I hate C++ Created 4 years, 3 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/extensions/api/sync_file_system/sync_file_system_api.cc
diff --git a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc
index 0fdc9a6b63c6ba2d1fda168b06ccacd3f6f5590e..c89dad722b3a2f13a2a048938597b2adb3cfeeac 100644
--- a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc
+++ b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc
@@ -275,8 +275,7 @@ void SyncFileSystemGetFileStatusesFunction::DidGetFileStatus(
std::unique_ptr<base::ListValue> status_array(new base::ListValue());
for (URLToStatusMap::iterator it = file_sync_statuses_.begin();
it != file_sync_statuses_.end(); ++it) {
- base::DictionaryValue* dict = new base::DictionaryValue();
- status_array->Append(dict);
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
storage::FileSystemURL url = it->first;
SyncStatusCode file_error = it->second.first;
@@ -290,6 +289,8 @@ void SyncFileSystemGetFileStatusesFunction::DidGetFileStatus(
if (file_error == sync_file_system::SYNC_STATUS_OK)
continue;
dict->SetString("error", ErrorToString(file_error));
+
+ status_array->Append(std::move(dict));
}
SetResult(std::move(status_array));

Powered by Google App Engine
This is Rietveld 408576698