summaryrefslogtreecommitdiffstats
path: root/chrome/browser/signin
diff options
context:
space:
mode:
authorraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-12 00:26:51 +0000
committerraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-12 00:26:51 +0000
commitce5b5805429eb63e2d76fdd4a5b79a2b62771349 (patch)
treefd782a5a0bd7cc1506573411637271d7a9c8db4a /chrome/browser/signin
parente3e5c805da46e77138ae0193967303543b0019dc (diff)
downloadchromium_src-ce5b5805429eb63e2d76fdd4a5b79a2b62771349.zip
chromium_src-ce5b5805429eb63e2d76fdd4a5b79a2b62771349.tar.gz
chromium_src-ce5b5805429eb63e2d76fdd4a5b79a2b62771349.tar.bz2
Revert 205670 "Un-refcount AutofillWebData and TokenWebData"
> Un-refcount AutofillWebData and TokenWebData > > depends on https://codereview.chromium.org/15927029/ > > BUG=230920 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=205038 > > Review URL: https://chromiumcodereview.appspot.com/16154031 TBR=caitkp@chromium.org Review URL: https://codereview.chromium.org/16347019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205685 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/signin')
-rw-r--r--chrome/browser/signin/token_service.cc7
-rw-r--r--chrome/browser/signin/token_service.h6
2 files changed, 5 insertions, 8 deletions
diff --git a/chrome/browser/signin/token_service.cc b/chrome/browser/signin/token_service.cc
index 51eee1e..2237ada 100644
--- a/chrome/browser/signin/token_service.cc
+++ b/chrome/browser/signin/token_service.cc
@@ -49,7 +49,6 @@ const char* kServices[] = {
TokenService::TokenService()
: profile_(NULL),
- token_web_data_(NULL),
token_loading_query_(0),
tokens_loaded_(false) {
// Allow constructor to be called outside the UI thread, so it can be mocked
@@ -176,20 +175,20 @@ void TokenService::UpdateCredentialsWithOAuth2(
void TokenService::LoadTokensFromDB() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (token_web_data_)
+ if (token_web_data_.get())
token_loading_query_ = token_web_data_->GetAllTokens(this);
}
void TokenService::SaveAuthTokenToDB(const std::string& service,
const std::string& auth_token) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (token_web_data_)
+ if (token_web_data_.get())
token_web_data_->SetTokenForService(service, auth_token);
}
void TokenService::EraseTokensFromDB() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (token_web_data_)
+ if (token_web_data_.get())
token_web_data_->RemoveAllTokens();
content::NotificationService::current()->Notify(
diff --git a/chrome/browser/signin/token_service.h b/chrome/browser/signin/token_service.h
index ebe9595..5ab612cc 100644
--- a/chrome/browser/signin/token_service.h
+++ b/chrome/browser/signin/token_service.h
@@ -228,10 +228,8 @@ class TokenService : public GaiaAuthConsumer,
// The profile with which this instance was initialized, or NULL.
Profile* profile_;
- // Web data service to access tokens from. Owned by WebDataServiceWrapper,
- // which outlives TokenService.
- TokenWebData* token_web_data_;
-
+ // Web data service to access tokens from.
+ scoped_refptr<TokenWebData> token_web_data_;
// Getter to use for fetchers.
scoped_refptr<net::URLRequestContextGetter> getter_;
// Request handle to load Gaia tokens from DB.