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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/sync_engine.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync_file_system/drive_backend/sync_engine.h" 5 #include "chrome/browser/sync_file_system/drive_backend/sync_engine.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 OAuth2TokenService* token_service = 194 OAuth2TokenService* token_service =
195 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); 195 ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
196 scoped_refptr<net::URLRequestContextGetter> request_context = 196 scoped_refptr<net::URLRequestContextGetter> request_context =
197 content::BrowserContext::GetDefaultStoragePartition(context)-> 197 content::BrowserContext::GetDefaultStoragePartition(context)->
198 GetURLRequestContext(); 198 GetURLRequestContext();
199 199
200 std::unique_ptr<drive_backend::SyncEngine> sync_engine(new SyncEngine( 200 std::unique_ptr<drive_backend::SyncEngine> sync_engine(new SyncEngine(
201 ui_task_runner.get(), worker_task_runner.get(), drive_task_runner.get(), 201 ui_task_runner.get(), worker_task_runner.get(), drive_task_runner.get(),
202 worker_pool.get(), GetSyncFileSystemDir(context->GetPath()), task_logger, 202 worker_pool.get(), GetSyncFileSystemDir(context->GetPath()), task_logger,
203 notification_manager, extension_service, signin_manager, token_service, 203 notification_manager, extension_service, signin_manager, token_service,
204 request_context.get(), base::WrapUnique(new DriveServiceFactory()), 204 request_context.get(), base::MakeUnique<DriveServiceFactory>(),
205 nullptr /* env_override */)); 205 nullptr /* env_override */));
206 206
207 sync_engine->Initialize(); 207 sync_engine->Initialize();
208 return sync_engine; 208 return sync_engine;
209 } 209 }
210 210
211 void SyncEngine::AppendDependsOnFactories( 211 void SyncEngine::AppendDependsOnFactories(
212 std::set<BrowserContextKeyedServiceFactory*>* factories) { 212 std::set<BrowserContextKeyedServiceFactory*>* factories) {
213 DCHECK(factories); 213 DCHECK(factories);
214 factories->insert(drive::DriveNotificationManagerFactory::GetInstance()); 214 factories->insert(drive::DriveNotificationManagerFactory::GetInstance());
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 776
777 SyncStatusCallback SyncEngine::TrackCallback( 777 SyncStatusCallback SyncEngine::TrackCallback(
778 const SyncStatusCallback& callback) { 778 const SyncStatusCallback& callback) {
779 return callback_tracker_.Register( 779 return callback_tracker_.Register(
780 base::Bind(callback, SYNC_STATUS_ABORT), 780 base::Bind(callback, SYNC_STATUS_ABORT),
781 callback); 781 callback);
782 } 782 }
783 783
784 } // namespace drive_backend 784 } // namespace drive_backend
785 } // namespace sync_file_system 785 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698