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 #include "chrome/browser/signin/token_service.h" | 5 #include "chrome/browser/signin/token_service.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
362 std::string lsid; | 362 std::string lsid; |
363 std::string sid; | 363 std::string sid; |
364 | 364 |
365 if (db_tokens.count(GaiaConstants::kGaiaLsid) > 0) | 365 if (db_tokens.count(GaiaConstants::kGaiaLsid) > 0) |
366 lsid = db_tokens.find(GaiaConstants::kGaiaLsid)->second; | 366 lsid = db_tokens.find(GaiaConstants::kGaiaLsid)->second; |
367 | 367 |
368 if (db_tokens.count(GaiaConstants::kGaiaSid) > 0) | 368 if (db_tokens.count(GaiaConstants::kGaiaSid) > 0) |
369 sid = db_tokens.find(GaiaConstants::kGaiaSid)->second; | 369 sid = db_tokens.find(GaiaConstants::kGaiaSid)->second; |
370 | 370 |
371 if (!lsid.empty() && !sid.empty()) { | 371 if (!lsid.empty() && !sid.empty()) { |
372 UpdateCredentials(GaiaAuthConsumer::ClientLoginResult(sid, | 372 credentials_ = GaiaAuthConsumer::ClientLoginResult(sid, |
Andrew T Wilson (Slow)
2012/07/27 18:01:16
Are you sure it's safe to skip all the other stuff
Roger Tawa OOO till Jul 10th
2012/07/27 18:18:35
I think it may be safer to change only the persist
Raghu Simha
2012/07/27 21:04:35
Here's my understanding of what's going on in Load
Roger Tawa OOO till Jul 10th
2012/07/27 21:21:45
True that this is called only during init, but it
Raghu Simha
2012/07/27 21:37:01
I stepped through the code with a debugger for sig
| |
373 lsid, | 373 lsid, |
374 std::string(), | 374 std::string(), |
375 std::string())); | 375 std::string()); |
376 } | 376 } |
377 } | 377 } |
378 } | 378 } |
379 | 379 |
380 void TokenService::LoadSingleTokenIntoMemory( | 380 void TokenService::LoadSingleTokenIntoMemory( |
381 const std::map<std::string, std::string>& db_tokens, | 381 const std::map<std::string, std::string>& db_tokens, |
382 std::map<std::string, std::string>* in_memory_tokens, | 382 std::map<std::string, std::string>* in_memory_tokens, |
383 const std::string& service) { | 383 const std::string& service) { |
384 // OnIssueAuthTokenSuccess should come from the same thread. | 384 // OnIssueAuthTokenSuccess should come from the same thread. |
385 // If a token is already present in the map, it could only have | 385 // If a token is already present in the map, it could only have |
(...skipping 15 matching lines...) Expand all Loading... | |
401 } | 401 } |
402 | 402 |
403 void TokenService::Observe(int type, | 403 void TokenService::Observe(int type, |
404 const content::NotificationSource& source, | 404 const content::NotificationSource& source, |
405 const content::NotificationDetails& details) { | 405 const content::NotificationDetails& details) { |
406 DCHECK_EQ(type, chrome::NOTIFICATION_TOKEN_UPDATED); | 406 DCHECK_EQ(type, chrome::NOTIFICATION_TOKEN_UPDATED); |
407 TokenAvailableDetails* tok_details = | 407 TokenAvailableDetails* tok_details = |
408 content::Details<TokenAvailableDetails>(details).ptr(); | 408 content::Details<TokenAvailableDetails>(details).ptr(); |
409 OnIssueAuthTokenSuccess(tok_details->service(), tok_details->token()); | 409 OnIssueAuthTokenSuccess(tok_details->service(), tok_details->token()); |
410 } | 410 } |
OLD | NEW |