OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 to call ClientLogin to derive a new SID and | 7 // the token service is expected to call ClientLogin to derive a new SID and |
8 // LSID. Whenever such credentials are available, the TokenService should be | 8 // LSID. Whenever such credentials are available, the TokenService should be |
9 // updated with new credentials. The controller should then start fetching | 9 // updated with new credentials. The controller should then start fetching |
10 // tokens, which will be written to the database after retrieval, as well as | 10 // tokens, which will be written to the database after retrieval, as well as |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 scoped_refptr<URLRequestContextGetter> getter_; | 166 scoped_refptr<URLRequestContextGetter> getter_; |
167 // Request handle to load Gaia tokens from DB. | 167 // Request handle to load Gaia tokens from DB. |
168 WebDataService::Handle token_loading_query_; | 168 WebDataService::Handle token_loading_query_; |
169 | 169 |
170 // Gaia request source for Gaia accounting. | 170 // Gaia request source for Gaia accounting. |
171 std::string source_; | 171 std::string source_; |
172 // Credentials from ClientLogin for Issuing auth tokens. | 172 // Credentials from ClientLogin for Issuing auth tokens. |
173 GaiaAuthConsumer::ClientLoginResult credentials_; | 173 GaiaAuthConsumer::ClientLoginResult credentials_; |
174 | 174 |
175 // Size of array of services (must be defined here). | 175 // Size of array of services (must be defined here). |
176 static const int kNumServices = 2; | 176 static const int kNumServices = 3; |
177 // List of services that we're performing operations for. | 177 // List of services that we're performing operations for. |
178 static const char* kServices[kNumServices]; | 178 static const char* kServices[kNumServices]; |
179 // A bunch of fetchers suitable for token issuing. We don't care about | 179 // A bunch of fetchers suitable for token issuing. We don't care about |
180 // the ordering, nor do we care which is for which service. | 180 // the ordering, nor do we care which is for which service. |
181 scoped_ptr<GaiaAuthenticator2> fetchers_[kNumServices]; | 181 scoped_ptr<GaiaAuthenticator2> fetchers_[kNumServices]; |
182 // Map from service to token. | 182 // Map from service to token. |
183 std::map<std::string, std::string> token_map_; | 183 std::map<std::string, std::string> token_map_; |
184 | 184 |
185 NotificationRegistrar registrar_; | 185 NotificationRegistrar registrar_; |
186 | 186 |
187 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryBasic); | 187 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryBasic); |
188 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryAdvanced); | 188 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryAdvanced); |
189 | 189 |
190 DISALLOW_COPY_AND_ASSIGN(TokenService); | 190 DISALLOW_COPY_AND_ASSIGN(TokenService); |
191 }; | 191 }; |
192 | 192 |
193 #endif // CHROME_BROWSER_NET_GAIA_TOKEN_SERVICE_H_ | 193 #endif // CHROME_BROWSER_NET_GAIA_TOKEN_SERVICE_H_ |
OLD | NEW |