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

Side by Side Diff: google_apis/gaia/oauth2_token_service.cc

Issue 345703003: Use OAuth2AccessTokenFetcher implementation on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@apikey
Patch Set: rebased Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/signin/android_profile_oauth2_token_service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "google_apis/gaia/oauth2_token_service.h" 5 #include "google_apis/gaia/oauth2_token_service.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 void OAuth2TokenService::Fetcher::AddWaitingRequest( 337 void OAuth2TokenService::Fetcher::AddWaitingRequest(
338 base::WeakPtr<OAuth2TokenService::RequestImpl> waiting_request) { 338 base::WeakPtr<OAuth2TokenService::RequestImpl> waiting_request) {
339 waiting_requests_.push_back(waiting_request); 339 waiting_requests_.push_back(waiting_request);
340 } 340 }
341 341
342 size_t OAuth2TokenService::Fetcher::GetWaitingRequestCount() const { 342 size_t OAuth2TokenService::Fetcher::GetWaitingRequestCount() const {
343 return waiting_requests_.size(); 343 return waiting_requests_.size();
344 } 344 }
345 345
346 void OAuth2TokenService::Fetcher::Cancel() { 346 void OAuth2TokenService::Fetcher::Cancel() {
347 if (fetcher_)
348 fetcher_->CancelRequest();
347 fetcher_.reset(); 349 fetcher_.reset();
348 retry_timer_.Stop(); 350 retry_timer_.Stop();
349 error_ = GoogleServiceAuthError(GoogleServiceAuthError::REQUEST_CANCELED); 351 error_ = GoogleServiceAuthError(GoogleServiceAuthError::REQUEST_CANCELED);
350 InformWaitingRequestsAndDelete(); 352 InformWaitingRequestsAndDelete();
351 } 353 }
352 354
353 const OAuth2TokenService::ScopeSet& OAuth2TokenService::Fetcher::GetScopeSet() 355 const OAuth2TokenService::ScopeSet& OAuth2TokenService::Fetcher::GetScopeSet()
354 const { 356 const {
355 return scopes_; 357 return scopes_;
356 } 358 }
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 const std::string& account_id, 799 const std::string& account_id,
798 const ScopeSet& scopes) const { 800 const ScopeSet& scopes) const {
799 PendingFetcherMap::const_iterator iter = pending_fetchers_.find( 801 PendingFetcherMap::const_iterator iter = pending_fetchers_.find(
800 OAuth2TokenService::RequestParameters( 802 OAuth2TokenService::RequestParameters(
801 client_id, 803 client_id,
802 account_id, 804 account_id,
803 scopes)); 805 scopes));
804 return iter == pending_fetchers_.end() ? 806 return iter == pending_fetchers_.end() ?
805 0 : iter->second->GetWaitingRequestCount(); 807 0 : iter->second->GetWaitingRequestCount();
806 } 808 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/android_profile_oauth2_token_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698