| 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);
|
| }
|
|
|