Commit 0a263965 authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

Remove PO2TS::DiagnosticsClient

This infrastructure is no longer used after
https://chromium-review.googlesource.com/c/chromium/src/+/1228197.

Bug: 883722
Change-Id: I9871ce8297ab42a8b173e61880570e076ae9277c
Reviewed-on: https://chromium-review.googlesource.com/1235575
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593497}
parent 8fb933f6
...@@ -15,8 +15,7 @@ ProfileOAuth2TokenService::ProfileOAuth2TokenService( ...@@ -15,8 +15,7 @@ ProfileOAuth2TokenService::ProfileOAuth2TokenService(
std::unique_ptr<OAuth2TokenServiceDelegate> delegate) std::unique_ptr<OAuth2TokenServiceDelegate> delegate)
: OAuth2TokenService(std::move(delegate)), : OAuth2TokenService(std::move(delegate)),
user_prefs_(user_prefs), user_prefs_(user_prefs),
all_credentials_loaded_(false), all_credentials_loaded_(false) {
diagnostics_client_(nullptr) {
DCHECK(user_prefs_); DCHECK(user_prefs_);
AddObserver(this); AddObserver(this);
} }
...@@ -78,14 +77,6 @@ void ProfileOAuth2TokenService::OnRefreshTokenAvailable( ...@@ -78,14 +77,6 @@ void ProfileOAuth2TokenService::OnRefreshTokenAvailable(
is_valid = false; is_valid = false;
} }
// NOTE: The code executed in the rest of this method does not affect the
// state of the accounts in this object, so it doesn't matter whether the
// callout to |diagnostics_client_| is made before or after. If that fact ever
// changes, it will be necessary to reason about what the ordering should be.
if (diagnostics_client_) {
diagnostics_client_->WillFireOnRefreshTokenAvailable(account_id, is_valid);
}
CancelRequestsForAccount(account_id); CancelRequestsForAccount(account_id);
ClearCacheForAccount(account_id); ClearCacheForAccount(account_id);
} }
...@@ -95,14 +86,6 @@ void ProfileOAuth2TokenService::OnRefreshTokenRevoked( ...@@ -95,14 +86,6 @@ void ProfileOAuth2TokenService::OnRefreshTokenRevoked(
// If this was the last token, recreate the device ID. // If this was the last token, recreate the device ID.
RecreateDeviceIdIfNeeded(); RecreateDeviceIdIfNeeded();
// NOTE: The code executed in the rest of this method does not affect the
// state of the accounts in this object, so it doesn't matter whether the
// callout to |diagnostics_client_| is made before or after. If that fact ever
// changes, it will be necessary to reason about what the ordering should be.
if (diagnostics_client_) {
diagnostics_client_->WillFireOnRefreshTokenRevoked(account_id);
}
CancelRequestsForAccount(account_id); CancelRequestsForAccount(account_id);
ClearCacheForAccount(account_id); ClearCacheForAccount(account_id);
} }
......
...@@ -79,37 +79,10 @@ class ProfileOAuth2TokenService : public OAuth2TokenService, ...@@ -79,37 +79,10 @@ class ProfileOAuth2TokenService : public OAuth2TokenService,
private: private:
friend class identity::IdentityManager; friend class identity::IdentityManager;
// Interface that gives information on internal TokenService operations. Only
// for use by IdentityManager during the conversion of the codebase to use
// //services/identity/public/cpp.
// NOTE: This interface is defined on ProfileOAuth2TokenService rather than
// on the OAuth2TokenService base class for multiple reasons:
// (1) The base class already has a DiagnosticsObserver interface, from
// which this interface differs because there can be only one instance.
// (2) PO2TS itself observes O2TS and for correctness must receive observer
// callbacks before any other O2TS observer. Hence, these DiagnosticsClient
// callouts must go *inside* PO2TS's implementations of the O2TS observer
// methods.
class DiagnosticsClient {
public:
// Sent just before OnRefreshTokenAvailable() is fired on observers.
// |is_valid| indicates whether the token is valid.
virtual void WillFireOnRefreshTokenAvailable(const std::string& account_id,
bool is_valid) = 0;
// Sent just before OnRefreshTokenRevoked() is fired on observers.
virtual void WillFireOnRefreshTokenRevoked(
const std::string& account_id) = 0;
};
void OnRefreshTokenAvailable(const std::string& account_id) override; void OnRefreshTokenAvailable(const std::string& account_id) override;
void OnRefreshTokenRevoked(const std::string& account_id) override; void OnRefreshTokenRevoked(const std::string& account_id) override;
void OnRefreshTokensLoaded() override; void OnRefreshTokensLoaded() override;
void set_diagnostics_client(DiagnosticsClient* diagnostics_client) {
DCHECK(!diagnostics_client_ || !diagnostics_client);
diagnostics_client_ = diagnostics_client;
}
// Creates a new device ID if there are no accounts, or if the current device // Creates a new device ID if there are no accounts, or if the current device
// ID is empty. // ID is empty.
void RecreateDeviceIdIfNeeded(); void RecreateDeviceIdIfNeeded();
...@@ -119,9 +92,6 @@ class ProfileOAuth2TokenService : public OAuth2TokenService, ...@@ -119,9 +92,6 @@ class ProfileOAuth2TokenService : public OAuth2TokenService,
// Whether all credentials have been loaded. // Whether all credentials have been loaded.
bool all_credentials_loaded_; bool all_credentials_loaded_;
// The DiagnosticsClient object associated with this object. May be null.
DiagnosticsClient* diagnostics_client_;
DISALLOW_COPY_AND_ASSIGN(ProfileOAuth2TokenService); DISALLOW_COPY_AND_ASSIGN(ProfileOAuth2TokenService);
}; };
......
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