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

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

Issue 8662002: Revive reverted CL with fix for CrOS build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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_access_token_fetcher.cc
===================================================================
--- chrome/common/net/gaia/oauth2_access_token_fetcher.cc (revision 111280)
+++ chrome/common/net/gaia/oauth2_access_token_fetcher.cc (working copy)
@@ -116,12 +116,12 @@
URLRequestStatus status = source->GetStatus();
if (!status.is_success()) {
- ReportFailure(CreateAuthError(status));
+ OnGetTokenFailure(CreateAuthError(status));
return;
}
if (source->GetResponseCode() != RC_REQUEST_OK) {
- ReportFailure(GoogleServiceAuthError(
+ OnGetTokenFailure(GoogleServiceAuthError(
GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS));
return;
}
@@ -129,20 +129,16 @@
// The request was successfully fetched and it returned OK.
// Parse out the access token.
std::string access_token;
- if (!ParseGetAccessTokenResponse(source, &access_token)) {
- ReportFailure(GoogleServiceAuthError(
- GoogleServiceAuthError::UNEXPECTED_RESPONSE));
- return;
- }
-
- ReportSuccess(access_token);
+ ParseGetAccessTokenResponse(source, &access_token);
+ OnGetTokenSuccess(access_token);
}
-void OAuth2AccessTokenFetcher::ReportSuccess(const std::string& access_token) {
+void OAuth2AccessTokenFetcher::OnGetTokenSuccess(
+ const std::string& access_token) {
consumer_->OnGetTokenSuccess(access_token);
}
-void OAuth2AccessTokenFetcher::ReportFailure(GoogleServiceAuthError error) {
+void OAuth2AccessTokenFetcher::OnGetTokenFailure(GoogleServiceAuthError error) {
state_ = ERROR_STATE;
consumer_->OnGetTokenFailure(error);
}
« no previous file with comments | « chrome/common/net/gaia/oauth2_access_token_fetcher.h ('k') | chrome/common/net/gaia/oauth2_access_token_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698