| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // The TokenService will supply authentication tokens for any service that | 5 // The TokenService will supply authentication tokens for any service that |
| 6 // needs it, such as sync. Whenever the user logs in, a controller watching | 6 // needs it, such as sync. Whenever the user logs in, a controller watching |
| 7 // the token service is expected either to call ClientLogin to derive a new | 7 // the token service is expected either to call ClientLogin to derive a new |
| 8 // SID and LSID, or to use GAIA OAuth requests to derive an OAuth1 access | 8 // SID and LSID, or to use GAIA OAuth requests to derive an OAuth1 access |
| 9 // token for the OAuthLogin scope. Whenever such credentials are available, | 9 // token for the OAuthLogin scope. Whenever such credentials are available, |
| 10 // the TokenService should be updated with new credentials. The controller | 10 // the TokenService should be updated with new credentials. The controller |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 221 |
| 222 void SaveAuthTokenToDB(const std::string& service, | 222 void SaveAuthTokenToDB(const std::string& service, |
| 223 const std::string& auth_token); | 223 const std::string& auth_token); |
| 224 | 224 |
| 225 // Returns the index of the given service. | 225 // Returns the index of the given service. |
| 226 static int GetServiceIndex(const std::string& service); | 226 static int GetServiceIndex(const std::string& service); |
| 227 | 227 |
| 228 // The profile with which this instance was initialized, or NULL. | 228 // The profile with which this instance was initialized, or NULL. |
| 229 Profile* profile_; | 229 Profile* profile_; |
| 230 | 230 |
| 231 // Web data service to access tokens from. | 231 // Web data service to access tokens from. Owned by WebDataServiceWrapper, |
| 232 scoped_refptr<TokenWebData> token_web_data_; | 232 // which outlives TokenService. |
| 233 TokenWebData* token_web_data_; |
| 234 |
| 233 // Getter to use for fetchers. | 235 // Getter to use for fetchers. |
| 234 scoped_refptr<net::URLRequestContextGetter> getter_; | 236 scoped_refptr<net::URLRequestContextGetter> getter_; |
| 235 // Request handle to load Gaia tokens from DB. | 237 // Request handle to load Gaia tokens from DB. |
| 236 WebDataServiceBase::Handle token_loading_query_; | 238 WebDataServiceBase::Handle token_loading_query_; |
| 237 // True if token loading has completed (regardless of success). | 239 // True if token loading has completed (regardless of success). |
| 238 bool tokens_loaded_; | 240 bool tokens_loaded_; |
| 239 | 241 |
| 240 // Gaia request source for Gaia accounting. | 242 // Gaia request source for Gaia accounting. |
| 241 std::string source_; | 243 std::string source_; |
| 242 // Credentials from ClientLogin for Issuing auth tokens. | 244 // Credentials from ClientLogin for Issuing auth tokens. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 258 | 260 |
| 259 friend class TokenServiceTest; | 261 friend class TokenServiceTest; |
| 260 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryBasic); | 262 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryBasic); |
| 261 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryAdvanced); | 263 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryAdvanced); |
| 262 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, FullIntegrationNewServicesAdded); | 264 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, FullIntegrationNewServicesAdded); |
| 263 | 265 |
| 264 DISALLOW_COPY_AND_ASSIGN(TokenService); | 266 DISALLOW_COPY_AND_ASSIGN(TokenService); |
| 265 }; | 267 }; |
| 266 | 268 |
| 267 #endif // CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_H_ | 269 #endif // CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_H_ |
| OLD | NEW |