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

Unified Diff: components/drive/service/fake_drive_service.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
« no previous file with comments | « components/drive/drive_app_registry.cc ('k') | components/error_page/renderer/net_error_helper_core.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c7ae70dded42b372c7137ccbbcb05a56a490d8b2 100644
--- a/components/drive/service/fake_drive_service.cc
+++ b/components/drive/service/fake_drive_service.cc
@@ -6,8 +6,10 @@
#include <stddef.h>
+#include <memory>
#include <string>
#include <utility>
+#include <vector>
#include "base/files/file_util.h"
#include "base/json/json_string_value_serializer.h"
@@ -132,7 +134,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 +1665,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 +1723,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));
}
}
« no previous file with comments | « components/drive/drive_app_registry.cc ('k') | components/error_page/renderer/net_error_helper_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698