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

Side by Side Diff: components/signin/core/browser/profile_oauth2_token_service.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/signin/core/browser/profile_oauth2_token_service.h" 5 #include "components/signin/core/browser/profile_oauth2_token_service.h"
6 6
7 void ProfileOAuth2TokenService::OnRefreshTokenAvailable( 7 void ProfileOAuth2TokenService::OnRefreshTokenAvailable(
8 const std::string& account_id) { 8 const std::string& account_id) {
9 CancelRequestsForAccount(account_id); 9 CancelRequestsForAccount(account_id);
10 ClearCacheForAccount(account_id); 10 ClearCacheForAccount(account_id);
11 } 11 }
12 12
13 void ProfileOAuth2TokenService::OnRefreshTokenRevoked( 13 void ProfileOAuth2TokenService::OnRefreshTokenRevoked(
14 const std::string& account_id) { 14 const std::string& account_id) {
15 CancelRequestsForAccount(account_id); 15 CancelRequestsForAccount(account_id);
16 ClearCacheForAccount(account_id); 16 ClearCacheForAccount(account_id);
17 } 17 }
18 18
19 ProfileOAuth2TokenService::ProfileOAuth2TokenService( 19 ProfileOAuth2TokenService::ProfileOAuth2TokenService(
20 OAuth2TokenServiceDelegate* delegate) 20 std::unique_ptr<OAuth2TokenServiceDelegate> delegate)
21 : OAuth2TokenService(delegate) { 21 : OAuth2TokenService(std::move(delegate)) {
22 AddObserver(this); 22 AddObserver(this);
23 } 23 }
24 24
25 ProfileOAuth2TokenService::~ProfileOAuth2TokenService() { 25 ProfileOAuth2TokenService::~ProfileOAuth2TokenService() {
26 RemoveObserver(this); 26 RemoveObserver(this);
27 } 27 }
28 28
29 void ProfileOAuth2TokenService::Shutdown() { 29 void ProfileOAuth2TokenService::Shutdown() {
30 CancelAllRequests(); 30 CancelAllRequests();
31 GetDelegate()->Shutdown(); 31 GetDelegate()->Shutdown();
(...skipping 11 matching lines...) Expand all
43 } 43 }
44 44
45 void ProfileOAuth2TokenService::RevokeCredentials( 45 void ProfileOAuth2TokenService::RevokeCredentials(
46 const std::string& account_id) { 46 const std::string& account_id) {
47 GetDelegate()->RevokeCredentials(account_id); 47 GetDelegate()->RevokeCredentials(account_id);
48 } 48 }
49 49
50 const net::BackoffEntry* ProfileOAuth2TokenService::GetDelegateBackoffEntry() { 50 const net::BackoffEntry* ProfileOAuth2TokenService::GetDelegateBackoffEntry() {
51 return GetDelegate()->BackoffEntry(); 51 return GetDelegate()->BackoffEntry();
52 } 52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698