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

Unified Diff: chrome/browser/sync_file_system/sync_file_system_service.cc

Issue 2767893002: Remove ScopedVector from chrome/browser/. (Closed)
Patch Set: Address comments from zea@ 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: chrome/browser/sync_file_system/sync_file_system_service.cc
diff --git a/chrome/browser/sync_file_system/sync_file_system_service.cc b/chrome/browser/sync_file_system/sync_file_system_service.cc
index 2ea9673d28e4912d54e9098ddcd36057e8054ccf..235c0dd49c143e5fa2cf6ae3f1ba61990fa3ee7e 100644
--- a/chrome/browser/sync_file_system/sync_file_system_service.cc
+++ b/chrome/browser/sync_file_system/sync_file_system_service.cc
@@ -460,10 +460,9 @@ void SyncFileSystemService::Initialize(
local_service_ = std::move(local_service);
remote_service_ = std::move(remote_service);
- std::unique_ptr<LocalSyncRunner> local_syncer(
- new LocalSyncRunner(kLocalSyncName, this));
- std::unique_ptr<RemoteSyncRunner> remote_syncer(
- new RemoteSyncRunner(kRemoteSyncName, this, remote_service_.get()));
+ auto local_syncer = base::MakeUnique<LocalSyncRunner>(kLocalSyncName, this);
+ auto remote_syncer = base::MakeUnique<RemoteSyncRunner>(
+ kRemoteSyncName, this, remote_service_.get());
local_service_->AddChangeObserver(local_syncer.get());
local_service_->SetLocalChangeProcessorCallback(
@@ -473,8 +472,8 @@ void SyncFileSystemService::Initialize(
remote_service_->AddFileStatusObserver(this);
remote_service_->SetRemoteChangeProcessor(local_service_.get());
- local_sync_runners_.push_back(local_syncer.release());
- remote_sync_runners_.push_back(remote_syncer.release());
+ local_sync_runners_.push_back(std::move(local_syncer));
+ remote_sync_runners_.push_back(std::move(remote_syncer));
syncer::SyncService* profile_sync_service =
ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(profile_);
@@ -756,14 +755,12 @@ void SyncFileSystemService::UpdateSyncEnabledStatus(
void SyncFileSystemService::RunForEachSyncRunners(
void(SyncProcessRunner::*method)()) {
- for (ScopedVector<SyncProcessRunner>::iterator iter =
- local_sync_runners_.begin();
+ for (auto iter = local_sync_runners_.begin();
iter != local_sync_runners_.end(); ++iter)
- ((*iter)->*method)();
- for (ScopedVector<SyncProcessRunner>::iterator iter =
- remote_sync_runners_.begin();
+ (iter->get()->*method)();
+ for (auto iter = remote_sync_runners_.begin();
iter != remote_sync_runners_.end(); ++iter)
- ((*iter)->*method)();
+ (iter->get()->*method)();
}
} // namespace sync_file_system
« no previous file with comments | « chrome/browser/sync_file_system/sync_file_system_service.h ('k') | chrome/browser/task_manager/sampling/task_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698