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

Unified Diff: chrome/browser/chromeos/login/oauth2_policy_fetcher.cc

Issue 11969010: Fixed OAuth2 policy fetching retry logic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | « chrome/browser/chromeos/login/oauth2_policy_fetcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/oauth2_policy_fetcher.cc
diff --git a/chrome/browser/chromeos/login/oauth2_policy_fetcher.cc b/chrome/browser/chromeos/login/oauth2_policy_fetcher.cc
index 77f9fa65fd06f42673d43c43aecc11e3d9a72486..364c5ba8cf4aeac8861b49b59c8dcb1d23deada7 100644
--- a/chrome/browser/chromeos/login/oauth2_policy_fetcher.cc
+++ b/chrome/browser/chromeos/login/oauth2_policy_fetcher.cc
@@ -38,12 +38,8 @@ const char kServiceScopeChromeOSDeviceManagement[] =
OAuth2PolicyFetcher::OAuth2PolicyFetcher(
net::URLRequestContextGetter* auth_context_getter,
net::URLRequestContextGetter* system_context_getter)
- : refresh_token_fetcher_(
- new GaiaAuthFetcher(this,
- GaiaConstants::kChromeSource,
- auth_context_getter)),
- access_token_fetcher_(
- new OAuth2AccessTokenFetcher(this, system_context_getter)),
+ : auth_context_getter_(auth_context_getter),
+ system_context_getter_(system_context_getter),
retry_count_(0),
failed_(false) {
}
@@ -51,8 +47,7 @@ OAuth2PolicyFetcher::OAuth2PolicyFetcher(
OAuth2PolicyFetcher::OAuth2PolicyFetcher(
net::URLRequestContextGetter* system_context_getter,
const std::string& oauth2_refresh_token)
- : access_token_fetcher_(
- new OAuth2AccessTokenFetcher(this, system_context_getter)),
+ : system_context_getter_(system_context_getter),
oauth2_refresh_token_(oauth2_refresh_token),
retry_count_(0),
failed_(false) {
@@ -72,12 +67,18 @@ void OAuth2PolicyFetcher::Start() {
void OAuth2PolicyFetcher::StartFetchingRefreshToken() {
DCHECK(refresh_token_fetcher_.get());
+ refresh_token_fetcher_.reset(
+ new GaiaAuthFetcher(this,
+ GaiaConstants::kChromeSource,
+ auth_context_getter_));
refresh_token_fetcher_->StartCookieForOAuthLoginTokenExchange(EmptyString());
}
void OAuth2PolicyFetcher::StartFetchingAccessToken() {
std::vector<std::string> scopes;
scopes.push_back(kServiceScopeChromeOSDeviceManagement);
+ access_token_fetcher_.reset(
+ new OAuth2AccessTokenFetcher(this, system_context_getter_));
access_token_fetcher_->Start(
GaiaUrls::GetInstance()->oauth2_chrome_client_id(),
GaiaUrls::GetInstance()->oauth2_chrome_client_secret(),
« no previous file with comments | « chrome/browser/chromeos/login/oauth2_policy_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698