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

Side by Side Diff: chrome/browser/net/gaia/token_service.h

Issue 4121003: Implement device token fetcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final feedback Created 10 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/net/gaia/token_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/gaia/token_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698