Commit 12c233c2 authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

Convert StatusCallback to RepeatingCallback

This CL converts the DeviceOAuth2TokenService::StatusCallback
from base::Callback to base::RepeatingCallback.

This is a code health CL, no behavior change is expected.

Bug: 1007635
Change-Id: I956bbc22308bcf92be9e971889ccf9d047f9fa00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2277097
Auto-Submit: Xida Chen <xidachen@chromium.org>
Reviewed-by: default avatarAnqing Zhao <anqing@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784371}
parent 1d00db04
......@@ -63,11 +63,11 @@ DeviceOAuth2TokenService::~DeviceOAuth2TokenService() {
void DeviceOAuth2TokenService::SetAndSaveRefreshToken(
const std::string& refresh_token,
const StatusCallback& result_callback) {
StatusCallback result_callback) {
ReportServiceError(GoogleServiceAuthError::REQUEST_CANCELED);
state_ = STATE_VALIDATION_PENDING;
store_->SetAndSaveRefreshToken(refresh_token, result_callback);
store_->SetAndSaveRefreshToken(refresh_token, std::move(result_callback));
}
CoreAccountId DeviceOAuth2TokenService::GetRobotAccountId() const {
......
......@@ -34,13 +34,13 @@ class DeviceOAuth2TokenService : public OAuth2AccessTokenManager::Delegate,
public DeviceOAuth2TokenStore::Observer {
public:
typedef base::RepeatingCallback<void()> RefreshTokenAvailableCallback;
typedef base::Callback<void(bool)> StatusCallback;
typedef base::RepeatingCallback<void(bool)> StatusCallback;
// Persist the given refresh token on the device. Overwrites any previous
// value. Should only be called during initial device setup. Signals
// completion via the given callback, passing true if the operation succeeded.
void SetAndSaveRefreshToken(const std::string& refresh_token,
const StatusCallback& callback);
StatusCallback callback);
// Pull the robot account ID from device policy.
CoreAccountId GetRobotAccountId() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment