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

Unified Diff: chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.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: chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.cc
index 6115d81af32ba2697d931d65e0697695fe69b0e0..49845ec671945065f82f3ecf498ecc1788c3bc43 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.cc
+++ b/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.cc
@@ -180,11 +180,9 @@ void SyncEngineInitializer::DidFindSyncRoot(
return;
}
- ScopedVector<google_apis::FileResource>* items = file_list->mutable_items();
- for (ScopedVector<google_apis::FileResource>::iterator itr = items->begin();
- itr != items->end(); ++itr) {
- google_apis::FileResource* entry = *itr;
-
+ std::vector<std::unique_ptr<google_apis::FileResource>>* items =
+ file_list->mutable_items();
+ for (auto& entry : *items) {
// Ignore deleted folder.
if (entry->labels().is_trashed())
continue;
@@ -199,8 +197,7 @@ void SyncEngineInitializer::DidFindSyncRoot(
continue;
if (!sync_root_folder_ || LessOnCreationTime(*entry, *sync_root_folder_)) {
- sync_root_folder_.reset(entry);
- *itr = nullptr;
+ sync_root_folder_ = std::move(entry);
}
}
@@ -321,11 +318,12 @@ void SyncEngineInitializer::DidListAppRootFolders(
return;
}
- ScopedVector<google_apis::FileResource>* new_entries =
+ std::vector<std::unique_ptr<google_apis::FileResource>>* new_entries =
file_list->mutable_items();
app_root_folders_.insert(app_root_folders_.end(),
- new_entries->begin(), new_entries->end());
- new_entries->weak_clear();
+ std::make_move_iterator(new_entries->begin()),
+ std::make_move_iterator(new_entries->end()));
Avi (use Gerrit) 2017/01/09 17:18:29 Same question here about move + back_iterator and
leonhsl(Using Gerrit) 2017/01/10 04:39:36 Done.
+ new_entries->clear();
set_used_network(true);
if (!file_list->next_link().is_empty()) {

Powered by Google App Engine
This is Rietveld 408576698