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

Unified Diff: chrome/common/net/gaia/oauth2_api_call_flow.cc

Issue 9982015: Addressing comments from msw and rsleevi for the following patch which is (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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: chrome/common/net/gaia/oauth2_api_call_flow.cc
===================================================================
--- chrome/common/net/gaia/oauth2_api_call_flow.cc (revision 130661)
+++ chrome/common/net/gaia/oauth2_api_call_flow.cc (working copy)
@@ -34,7 +34,7 @@
tried_mint_access_token_(false) {
}
-OAuth2ApiCallFlow::~OAuth2ApiCallFlow() { }
+OAuth2ApiCallFlow::~OAuth2ApiCallFlow() {}
void OAuth2ApiCallFlow::Start() {
BeginApiCall();
@@ -46,10 +46,8 @@
// If the access token is empty then directly try to mint one.
if (access_token_.empty()) {
BeginMintAccessToken();
- return;
} else {
state_ = API_CALL_STARTED;
-
url_fetcher_.reset(CreateURLFetcher());
url_fetcher_->Start(); // OnURLFetchComplete will be called.
}
@@ -61,6 +59,7 @@
URLRequestStatus status = source->GetStatus();
if (!status.is_success()) {
+ state_ = ERROR_STATE;
ProcessApiCallFailure(source);
return;
}
@@ -69,15 +68,18 @@
// expired. So try generating a new access token.
if (source->GetResponseCode() == net::HTTP_UNAUTHORIZED) {
// If we already tried minting a new access token, don't do it again.
- if (tried_mint_access_token_)
+ if (tried_mint_access_token_) {
+ state_ = ERROR_STATE;
ProcessApiCallFailure(source);
- else
+ } else {
BeginMintAccessToken();
+ }
return;
}
if (source->GetResponseCode() != net::HTTP_OK) {
+ state_ = ERROR_STATE;
ProcessApiCallFailure(source);
return;
}
« no previous file with comments | « chrome/common/net/gaia/oauth2_api_call_flow.h ('k') | chrome/common/net/gaia/oauth2_api_call_flow_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698