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

Unified Diff: chrome/browser/signin/token_service.cc

Issue 10213013: Now CHECKs to make sure we log out before clearing the token db (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/signin/signin_manager.cc ('k') | chrome/browser/sync/glue/typed_url_model_associator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/token_service.cc
diff --git a/chrome/browser/signin/token_service.cc b/chrome/browser/signin/token_service.cc
index da66af2c8dc4e1cbecb8600749a11b7cfdd373c8..d78e94f07d16924afb0fd6a68521e8151cce8168 100644
--- a/chrome/browser/signin/token_service.cc
+++ b/chrome/browser/signin/token_service.cc
@@ -7,11 +7,13 @@
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/string_util.h"
+#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/net/gaia/gaia_auth_fetcher.h"
#include "chrome/common/net/gaia/gaia_constants.h"
+#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
@@ -133,6 +135,13 @@ void TokenService::SaveAuthTokenToDB(const std::string& service,
void TokenService::EraseTokensFromDB() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ // Try to track down http://crbug.com/121755 - we should never clear the
+ // token DB while we're still logged in.
+ if (profile_) {
+ std::string user = profile_->GetPrefs()->GetString(
+ prefs::kGoogleServicesUsername);
tim (not reviewing) 2012/04/25 18:37:59 Is there anything else in TokenService that expect
+ CHECK(user.empty());
+ }
if (web_data_service_.get())
web_data_service_->RemoveAllTokens();
}
« no previous file with comments | « chrome/browser/signin/signin_manager.cc ('k') | chrome/browser/sync/glue/typed_url_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698