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

Unified Diff: google_apis/gaia/oauth2_token_service_delegate.h

Issue 1267843003: Fix reconcilor loop when the primary account is in an auth error state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 5 years, 4 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: google_apis/gaia/oauth2_token_service_delegate.h
diff --git a/google_apis/gaia/oauth2_token_service_delegate.h b/google_apis/gaia/oauth2_token_service_delegate.h
index cb38c2eb0e5a3a60a16db7dfbf16129ee71a3da8..3a2d39fb246962cbd73e173aa390b4cf5de5831b 100644
--- a/google_apis/gaia/oauth2_token_service_delegate.h
+++ b/google_apis/gaia/oauth2_token_service_delegate.h
@@ -29,8 +29,9 @@ class OAuth2TokenServiceDelegate {
OAuth2AccessTokenConsumer* consumer) = 0;
virtual bool RefreshTokenIsAvailable(const std::string& account_id) const = 0;
+ virtual bool RefreshTokenHasError(const std::string& account_id) const;
virtual void UpdateAuthError(const std::string& account_id,
- const GoogleServiceAuthError& error){};
+ const GoogleServiceAuthError& error) {}
virtual std::vector<std::string> GetAccounts();
virtual void RevokeAllCredentials(){};
@@ -70,6 +71,12 @@ class OAuth2TokenServiceDelegate {
DISALLOW_COPY_AND_ASSIGN(ScopedBatchChange);
};
+ // This function is called by derived classes to help implement
+ // RefreshTokenHasError(). It centralizes the code for determining if
+ // |error| is worthy of being reported as an error for purposes of
+ // RefreshTokenHasError().
+ static bool IsError(const GoogleServiceAuthError& error);
+
private:
// List of observers to notify when refresh token availability changes.
// Makes sure list is empty on destruction.
« no previous file with comments | « google_apis/gaia/fake_oauth2_token_service_delegate.cc ('k') | google_apis/gaia/oauth2_token_service_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698