Index: chrome/browser/signin/dice_response_handler.h |
diff --git a/chrome/browser/signin/dice_response_handler.h b/chrome/browser/signin/dice_response_handler.h |
index 8c4a1fdb29f49c1864ab39d1c911740402eab93e..17e7e620abe93aa07c10863d919a624c86d31290 100644 |
--- a/chrome/browser/signin/dice_response_handler.h |
+++ b/chrome/browser/signin/dice_response_handler.h |
@@ -9,6 +9,7 @@ |
#include <string> |
#include <vector> |
+#include "base/cancelable_callback.h" |
#include "base/macros.h" |
#include "components/keyed_service/core/keyed_service.h" |
#include "google_apis/gaia/gaia_auth_consumer.h" |
@@ -24,6 +25,9 @@ class SigninClient; |
class ProfileOAuth2TokenService; |
class Profile; |
+// Exposed for testing. |
+extern const int kDiceTokenFetchTimeoutSeconds; |
+ |
// Processes the Dice responses from Gaia. |
class DiceResponseHandler : public KeyedService { |
public: |
@@ -39,6 +43,9 @@ class DiceResponseHandler : public KeyedService { |
// Must be called when receiving a Dice response header. |
void ProcessDiceHeader(const signin::DiceResponseParams& dice_params); |
+ // Returns the number of pending DiceTokenFetchers. Exposed for testing. |
+ size_t GetPendingDiceTokenFetchersCountForTesting() const; |
+ |
private: |
// Helper class to fetch a refresh token from an authorization code. |
class DiceTokenFetcher : public GaiaAuthConsumer { |
@@ -57,6 +64,9 @@ class DiceResponseHandler : public KeyedService { |
} |
private: |
+ // Called by |timeout_closure_| when the request times out. |
+ void OnTimeout(); |
+ |
// GaiaAuthConsumer implementation: |
void OnClientOAuthSuccess( |
const GaiaAuthConsumer::ClientOAuthResult& result) override; |
@@ -66,6 +76,7 @@ class DiceResponseHandler : public KeyedService { |
std::string email_; |
std::string authorization_code_; |
DiceResponseHandler* dice_response_handler_; |
+ base::CancelableClosure timeout_closure_; |
std::unique_ptr<GaiaAuthFetcher> gaia_auth_fetcher_; |
DISALLOW_COPY_AND_ASSIGN(DiceTokenFetcher); |