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

Unified Diff: chrome/browser/sync_file_system/drive_backend/folder_creator.cc

Issue 2613223002: Remove ScopedVector from base::JSONValueConverter (Closed)
Patch Set: Rebase and address comments from mmenke@ 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: chrome/browser/sync_file_system/drive_backend/folder_creator.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/folder_creator.cc b/chrome/browser/sync_file_system/drive_backend/folder_creator.cc
index 8a7ec887f4654586aa3d086953616e3b2a2b3ebf..4d732bcdfcb74200178adb22a7df92d5386ff188 100644
--- a/chrome/browser/sync_file_system/drive_backend/folder_creator.cc
+++ b/chrome/browser/sync_file_system/drive_backend/folder_creator.cc
@@ -56,14 +56,16 @@ void FolderCreator::DidCreateFolder(
drive_service_->SearchByTitle(
title_, parent_folder_id_,
- base::Bind(&FolderCreator::DidListFolders,
- weak_ptr_factory_.GetWeakPtr(), callback,
- base::Passed(ScopedVector<google_apis::FileResource>())));
+ base::Bind(
+ &FolderCreator::DidListFolders, weak_ptr_factory_.GetWeakPtr(),
+ callback,
+ base::Passed(
+ std::vector<std::unique_ptr<google_apis::FileResource>>())));
}
void FolderCreator::DidListFolders(
const FileIDCallback& callback,
- ScopedVector<google_apis::FileResource> candidates,
+ std::vector<std::unique_ptr<google_apis::FileResource>> candidates,
google_apis::DriveApiErrorCode error,
std::unique_ptr<google_apis::FileList> file_list) {
SyncStatusCode status = DriveApiErrorCodeToSyncStatusCode(error);
@@ -79,10 +81,9 @@ void FolderCreator::DidListFolders(
}
candidates.reserve(candidates.size() + file_list->items().size());
- candidates.insert(candidates.end(),
- file_list->items().begin(),
- file_list->items().end());
- file_list->mutable_items()->weak_clear();
+ std::move(file_list->mutable_items()->begin(),
+ file_list->mutable_items()->end(), std::back_inserter(candidates));
+ file_list->mutable_items()->clear();
if (!file_list->next_link().is_empty()) {
drive_service_->GetRemainingFileList(

Powered by Google App Engine
This is Rietveld 408576698