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

Unified Diff: components/drive/service/fake_drive_service.cc

Issue 2613223002: Remove ScopedVector from base::JSONValueConverter (Closed)
Patch Set: Created 3 years, 11 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: components/drive/service/fake_drive_service.cc
diff --git a/components/drive/service/fake_drive_service.cc b/components/drive/service/fake_drive_service.cc
index 26b23f3a4f4c2201cb3cc0809de4c49c9b776068..37c400c6bd88c82e2981d479a63e98ef21303ca8 100644
--- a/components/drive/service/fake_drive_service.cc
+++ b/components/drive/service/fake_drive_service.cc
@@ -132,7 +132,8 @@ void FileListCallbackAdapter(const FileListCallback& callback,
for (size_t i = 0; i < change_list->items().size(); ++i) {
const ChangeResource& entry = *change_list->items()[i];
if (entry.file())
- file_list->mutable_items()->push_back(new FileResource(*entry.file()));
+ file_list->mutable_items()->push_back(
+ base::MakeUnique<FileResource>(*entry.file()));
}
callback.Run(error, std::move(file_list));
}
@@ -1662,7 +1663,7 @@ void FakeDriveService::GetChangeListInternal(
// Filter out entries per parameters like |directory_resource_id| and
// |search_query|.
- ScopedVector<ChangeResource> entries;
+ std::vector<std::unique_ptr<ChangeResource>> entries;
int num_entries_matched = 0;
for (auto it = entries_.begin(); it != entries_.end(); ++it) {
const ChangeResource& entry = it->second->change_resource;
@@ -1720,7 +1721,7 @@ void FakeDriveService::GetChangeListInternal(
entry_copied->set_file(base::MakeUnique<FileResource>(*entry.file()));
}
entry_copied->set_modification_date(entry.modification_date());
- entries.push_back(entry_copied.release());
+ entries.push_back(std::move(entry_copied));
}
}

Powered by Google App Engine
This is Rietveld 408576698