| OLD | NEW |
| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // this Fetcher is destructed in the dtor of the OAuth2TokenService or is | 165 // this Fetcher is destructed in the dtor of the OAuth2TokenService or is |
| 166 // scheduled for deletion at the end of OnGetTokenFailure/OnGetTokenSuccess | 166 // scheduled for deletion at the end of OnGetTokenFailure/OnGetTokenSuccess |
| 167 // (whichever comes first). | 167 // (whichever comes first). |
| 168 OAuth2TokenService* const oauth2_token_service_; | 168 OAuth2TokenService* const oauth2_token_service_; |
| 169 scoped_refptr<net::URLRequestContextGetter> getter_; | 169 scoped_refptr<net::URLRequestContextGetter> getter_; |
| 170 const std::string account_id_; | 170 const std::string account_id_; |
| 171 const ScopeSet scopes_; | 171 const ScopeSet scopes_; |
| 172 std::vector<base::WeakPtr<RequestImpl> > waiting_requests_; | 172 std::vector<base::WeakPtr<RequestImpl> > waiting_requests_; |
| 173 | 173 |
| 174 int retry_number_; | 174 int retry_number_; |
| 175 base::OneShotTimer<Fetcher> retry_timer_; | 175 base::OneShotTimer retry_timer_; |
| 176 scoped_ptr<OAuth2AccessTokenFetcher> fetcher_; | 176 scoped_ptr<OAuth2AccessTokenFetcher> fetcher_; |
| 177 | 177 |
| 178 // Variables that store fetch results. | 178 // Variables that store fetch results. |
| 179 // Initialized to be GoogleServiceAuthError::SERVICE_UNAVAILABLE to handle | 179 // Initialized to be GoogleServiceAuthError::SERVICE_UNAVAILABLE to handle |
| 180 // destruction. | 180 // destruction. |
| 181 GoogleServiceAuthError error_; | 181 GoogleServiceAuthError error_; |
| 182 std::string access_token_; | 182 std::string access_token_; |
| 183 base::Time expiration_date_; | 183 base::Time expiration_date_; |
| 184 | 184 |
| 185 // OAuth2 client id and secret. | 185 // OAuth2 client id and secret. |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 const std::string& account_id, | 822 const std::string& account_id, |
| 823 const ScopeSet& scopes) const { | 823 const ScopeSet& scopes) const { |
| 824 PendingFetcherMap::const_iterator iter = pending_fetchers_.find( | 824 PendingFetcherMap::const_iterator iter = pending_fetchers_.find( |
| 825 OAuth2TokenService::RequestParameters( | 825 OAuth2TokenService::RequestParameters( |
| 826 client_id, | 826 client_id, |
| 827 account_id, | 827 account_id, |
| 828 scopes)); | 828 scopes)); |
| 829 return iter == pending_fetchers_.end() ? | 829 return iter == pending_fetchers_.end() ? |
| 830 0 : iter->second->GetWaitingRequestCount(); | 830 0 : iter->second->GetWaitingRequestCount(); |
| 831 } | 831 } |
| OLD | NEW |