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

Unified Diff: chrome/browser/chromeos/settings/device_oauth2_token_service.h

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/chromeos/settings/device_oauth2_token_service.h
diff --git a/chrome/browser/chromeos/settings/device_oauth2_token_service.h b/chrome/browser/chromeos/settings/device_oauth2_token_service.h
index d3182eaf0b40cf73ffd6deb352573533880235e2..b23e93a2ec0474786faf70009d3f20b679cb3afa 100644
--- a/chrome/browser/chromeos/settings/device_oauth2_token_service.h
+++ b/chrome/browser/chromeos/settings/device_oauth2_token_service.h
@@ -67,8 +67,8 @@ class DeviceOAuth2TokenService
void OnValidationCompleted(GoogleServiceAuthError::State error) override;
// Use DeviceOAuth2TokenServiceFactory to get an instance of this class.
- // Ownership of |token_encryptor| will be taken.
- explicit DeviceOAuth2TokenService(DeviceOAuth2TokenServiceDelegate* delegate);
+ explicit DeviceOAuth2TokenService(
+ std::unique_ptr<DeviceOAuth2TokenServiceDelegate> delegate);
~DeviceOAuth2TokenService() override;
// Flushes |pending_requests_|, indicating the specified result.
@@ -78,12 +78,13 @@ class DeviceOAuth2TokenService
// Signals failure on the specified request, passing |error| as the reason.
void FailRequest(RequestImpl* request, GoogleServiceAuthError::State error);
+ DeviceOAuth2TokenServiceDelegate* GetDeviceDelegate();
+ const DeviceOAuth2TokenServiceDelegate* GetDeviceDelegate() const;
+
// Currently open requests that are waiting while loading the system salt or
// validating the token.
std::vector<PendingRequest*> pending_requests_;
- DeviceOAuth2TokenServiceDelegate* delegate_;
-
DISALLOW_COPY_AND_ASSIGN(DeviceOAuth2TokenService);
};

Powered by Google App Engine
This is Rietveld 408576698