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

Unified Diff: trunk/src/chrome/browser/history/web_history_service.cc

Issue 12782018: Revert 190531 "Get OAuth2TokenService working on Android." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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: trunk/src/chrome/browser/history/web_history_service.cc
===================================================================
--- trunk/src/chrome/browser/history/web_history_service.cc (revision 190557)
+++ trunk/src/chrome/browser/history/web_history_service.cc (working copy)
@@ -64,7 +64,6 @@
: profile_(profile),
url_(GURL(url)),
response_code_(0),
- auth_retry_count_(0),
callback_(callback) {
}
@@ -82,19 +81,6 @@
virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE {
DCHECK_EQ(source, url_fetcher_.get());
response_code_ = url_fetcher_->GetResponseCode();
-
- // If the response code indicates that the token might not be valid,
- // invalidate the token and try again.
- if (response_code_ == net::HTTP_UNAUTHORIZED && ++auth_retry_count_ <= 1) {
- OAuth2TokenService::ScopeSet oauth_scopes;
- oauth_scopes.insert(kHistoryOAuthScope);
- OAuth2TokenServiceFactory::GetForProfile(profile_)->InvalidateToken(
- oauth_scopes, access_token_);
-
- access_token_ = std::string();
- Start();
- return;
- }
url_fetcher_->GetResponseAsString(&response_body_);
url_fetcher_.reset();
callback_.Run(this, true);
@@ -107,7 +93,6 @@
const base::Time& expiration_time) OVERRIDE {
token_request_.reset();
DCHECK(!access_token.empty());
- access_token_ = access_token;
// Got an access token -- start the actual API request.
url_fetcher_.reset(CreateUrlFetcher(access_token));
@@ -155,9 +140,6 @@
// The OAuth2 access token request.
scoped_ptr<OAuth2TokenService::Request> token_request_;
- // The current OAuth2 access token.
- std::string access_token_;
-
// Handles the actual API requests after the OAuth token is acquired.
scoped_ptr<net::URLFetcher> url_fetcher_;
@@ -167,10 +149,6 @@
// Holds the response body received from the server.
std::string response_body_;
- // The number of times this request has already been retried due to
- // authorization problems.
- int auth_retry_count_;
-
// The callback to execute when the query is complete.
CompletionCallback callback_;
};

Powered by Google App Engine
This is Rietveld 408576698