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

Unified Diff: chrome/browser/signin/profile_oauth2_token_service_factory.cc

Issue 2685123002: Make OAuth2TokenService and subclasses take delegate by unique_ptr (Closed)
Patch Set: Created 3 years, 10 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/signin/profile_oauth2_token_service_factory.cc
diff --git a/chrome/browser/signin/profile_oauth2_token_service_factory.cc b/chrome/browser/signin/profile_oauth2_token_service_factory.cc
index f9ce243f43050fbba3b2c3da9496b30c81ffb5c2..891f3c912e28be4faa305be478c959c4851dfe2d 100644
--- a/chrome/browser/signin/profile_oauth2_token_service_factory.cc
+++ b/chrome/browser/signin/profile_oauth2_token_service_factory.cc
@@ -52,16 +52,15 @@ KeyedService* ProfileOAuth2TokenServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
Profile* profile = static_cast<Profile*>(context);
#if defined(OS_ANDROID)
- OAuth2TokenServiceDelegateAndroid* delegate =
- new OAuth2TokenServiceDelegateAndroid(
- AccountTrackerServiceFactory::GetInstance()->GetForProfile(profile));
+ auto delegate = base::MakeUnique<OAuth2TokenServiceDelegateAndroid>(
+ AccountTrackerServiceFactory::GetInstance()->GetForProfile(profile));
#else
- MutableProfileOAuth2TokenServiceDelegate* delegate =
- new MutableProfileOAuth2TokenServiceDelegate(
- ChromeSigninClientFactory::GetInstance()->GetForProfile(profile),
- SigninErrorControllerFactory::GetInstance()->GetForProfile(profile),
- AccountTrackerServiceFactory::GetInstance()->GetForProfile(profile));
+ auto delegate = base::MakeUnique<MutableProfileOAuth2TokenServiceDelegate>(
+ ChromeSigninClientFactory::GetInstance()->GetForProfile(profile),
+ SigninErrorControllerFactory::GetInstance()->GetForProfile(profile),
+ AccountTrackerServiceFactory::GetInstance()->GetForProfile(profile));
#endif
- ProfileOAuth2TokenService* service = new ProfileOAuth2TokenService(delegate);
+ ProfileOAuth2TokenService* service =
+ new ProfileOAuth2TokenService(std::move(delegate));
return service;
}

Powered by Google App Engine
This is Rietveld 408576698