| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 const ScopeSet& GetScopeSet() const; | 144 const ScopeSet& GetScopeSet() const; |
| 145 const std::string& GetClientId() const; | 145 const std::string& GetClientId() const; |
| 146 const std::string& GetAccountId() const; | 146 const std::string& GetAccountId() const; |
| 147 | 147 |
| 148 // The error result from this fetcher. | 148 // The error result from this fetcher. |
| 149 const GoogleServiceAuthError& error() const { return error_; } | 149 const GoogleServiceAuthError& error() const { return error_; } |
| 150 | 150 |
| 151 protected: | 151 protected: |
| 152 // OAuth2AccessTokenConsumer | 152 // OAuth2AccessTokenConsumer |
| 153 virtual void OnGetTokenSuccess(const std::string& access_token, | 153 virtual void OnGetTokenSuccess(const std::string& access_token, |
| 154 const base::Time& expiration_date) OVERRIDE; | 154 const base::Time& expiration_date) override; |
| 155 virtual void OnGetTokenFailure( | 155 virtual void OnGetTokenFailure( |
| 156 const GoogleServiceAuthError& error) OVERRIDE; | 156 const GoogleServiceAuthError& error) override; |
| 157 | 157 |
| 158 private: | 158 private: |
| 159 Fetcher(OAuth2TokenService* oauth2_token_service, | 159 Fetcher(OAuth2TokenService* oauth2_token_service, |
| 160 const std::string& account_id, | 160 const std::string& account_id, |
| 161 net::URLRequestContextGetter* getter, | 161 net::URLRequestContextGetter* getter, |
| 162 const std::string& client_id, | 162 const std::string& client_id, |
| 163 const std::string& client_secret, | 163 const std::string& client_secret, |
| 164 const OAuth2TokenService::ScopeSet& scopes, | 164 const OAuth2TokenService::ScopeSet& scopes, |
| 165 base::WeakPtr<RequestImpl> waiting_request); | 165 base::WeakPtr<RequestImpl> waiting_request); |
| 166 void Start(); | 166 void Start(); |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 const std::string& account_id, | 799 const std::string& account_id, |
| 800 const ScopeSet& scopes) const { | 800 const ScopeSet& scopes) const { |
| 801 PendingFetcherMap::const_iterator iter = pending_fetchers_.find( | 801 PendingFetcherMap::const_iterator iter = pending_fetchers_.find( |
| 802 OAuth2TokenService::RequestParameters( | 802 OAuth2TokenService::RequestParameters( |
| 803 client_id, | 803 client_id, |
| 804 account_id, | 804 account_id, |
| 805 scopes)); | 805 scopes)); |
| 806 return iter == pending_fetchers_.end() ? | 806 return iter == pending_fetchers_.end() ? |
| 807 0 : iter->second->GetWaitingRequestCount(); | 807 0 : iter->second->GetWaitingRequestCount(); |
| 808 } | 808 } |
| OLD | NEW |