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

Unified Diff: google_apis/gaia/ubertoken_fetcher.h

Issue 597003002: UbertokenFecther should invalidate access token if it's invalid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@z359700
Patch Set: Refactor init Created 6 years, 3 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
« no previous file with comments | « no previous file | google_apis/gaia/ubertoken_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/ubertoken_fetcher.h
diff --git a/google_apis/gaia/ubertoken_fetcher.h b/google_apis/gaia/ubertoken_fetcher.h
index acc4bb4e1a781482f7ba46f1d0d531440438fa2d..950797c0cce5154878317a7df8e0e1defa425dd8 100644
--- a/google_apis/gaia/ubertoken_fetcher.h
+++ b/google_apis/gaia/ubertoken_fetcher.h
@@ -6,6 +6,7 @@
#define GOOGLE_APIS_GAIA_UBERTOKEN_FETCHER_H_
#include "base/memory/scoped_ptr.h"
+#include "base/timer/timer.h"
#include "google_apis/gaia/gaia_auth_consumer.h"
#include "google_apis/gaia/oauth2_token_service.h"
@@ -38,6 +39,9 @@ class UbertokenConsumer {
class UbertokenFetcher : public GaiaAuthConsumer,
public OAuth2TokenService::Consumer {
public:
+ // Maximum number of retries to get the uber-auth token before giving up.
+ static const int kMaxRetries;
+
UbertokenFetcher(OAuth2TokenService* token_service,
UbertokenConsumer* consumer,
net::URLRequestContextGetter* request_context);
@@ -59,11 +63,22 @@ class UbertokenFetcher : public GaiaAuthConsumer,
const GoogleServiceAuthError& error) OVERRIDE;
private:
+ // Request a login-scoped access token from the token service.
+ void RequestAccessToken();
+
+ // Exchanges an oauth2 access token for an uber-auth token.
+ void ExchangeTokens();
+
OAuth2TokenService* token_service_;
UbertokenConsumer* consumer_;
net::URLRequestContextGetter* request_context_;
scoped_ptr<GaiaAuthFetcher> gaia_auth_fetcher_;
scoped_ptr<OAuth2TokenService::Request> access_token_request_;
+ std::string account_id_;
+ std::string access_token_;
+ int retry_number_;
+ base::OneShotTimer<UbertokenFetcher> retry_timer_;
+ bool second_access_token_request_;
DISALLOW_COPY_AND_ASSIGN(UbertokenFetcher);
};
« no previous file with comments | « no previous file | google_apis/gaia/ubertoken_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698