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

Unified Diff: content/browser/background_sync/background_sync_manager.cc

Issue 2752533003: Remove ScopedVector from content/browser/. (Closed)
Patch Set: Created 3 years, 9 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: content/browser/background_sync/background_sync_manager.cc
diff --git a/content/browser/background_sync/background_sync_manager.cc b/content/browser/background_sync/background_sync_manager.cc
index 0e02f1d1cf2525785bcca74fd2462be522fe983d..947db22507cb4486cfd08108eaf67991e98862a0 100644
--- a/content/browser/background_sync/background_sync_manager.cc
+++ b/content/browser/background_sync/background_sync_manager.cc
@@ -216,9 +216,8 @@ void BackgroundSyncManager::GetRegistrations(
FROM_HERE,
base::Bind(
callback, BACKGROUND_SYNC_STATUS_STORAGE_ERROR,
- base::Passed(
- std::unique_ptr<ScopedVector<BackgroundSyncRegistration>>(
- new ScopedVector<BackgroundSyncRegistration>()))));
+ base::Passed(base::MakeUnique<std::vector<
+ std::unique_ptr<BackgroundSyncRegistration>>>())));
return;
}
@@ -789,13 +788,13 @@ void BackgroundSyncManager::GetRegistrationsImpl(
const StatusAndRegistrationsCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- std::unique_ptr<ScopedVector<BackgroundSyncRegistration>> out_registrations(
- new ScopedVector<BackgroundSyncRegistration>());
+ auto out_registrations = base::MakeUnique<
+ std::vector<std::unique_ptr<BackgroundSyncRegistration>>>();
if (disabled_) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(callback, BACKGROUND_SYNC_STATUS_STORAGE_ERROR,
- base::Passed(std::move(out_registrations))));
+ base::Passed(&out_registrations)));
return;
}
@@ -807,15 +806,14 @@ void BackgroundSyncManager::GetRegistrationsImpl(
for (const auto& tag_and_registration : registrations.registration_map) {
const BackgroundSyncRegistration& registration =
tag_and_registration.second;
- BackgroundSyncRegistration* out_registration =
- new BackgroundSyncRegistration(registration);
- out_registrations->push_back(out_registration);
+ out_registrations->push_back(
+ base::MakeUnique<BackgroundSyncRegistration>(registration));
}
}
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(callback, BACKGROUND_SYNC_STATUS_OK,
- base::Passed(std::move(out_registrations))));
+ base::Passed(&out_registrations)));
}
bool BackgroundSyncManager::AreOptionConditionsMet(

Powered by Google App Engine
This is Rietveld 408576698