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

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

Issue 15734014: Split token-related methods from WebDataService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix DEPs again Created 7 years, 7 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/token_service.h ('k') | chrome/browser/signin/token_service_unittest.h » ('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 17b17c148c2af6a2a297d28d878564b61ce48112..93645e0e27bbd7adcc04bb14ccfa3c16733f012e 100644
--- a/chrome/browser/signin/token_service.cc
+++ b/chrome/browser/signin/token_service.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -11,7 +11,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/signin_manager.h"
#include "chrome/browser/signin/signin_manager_factory.h"
-#include "chrome/browser/webdata/web_data_service.h"
+#include "chrome/browser/webdata/token_web_data.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@@ -66,7 +66,7 @@ void TokenService::Shutdown() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
ResetCredentialsInMemory();
}
- web_data_service_ = NULL;
+ token_web_data_ = NULL;
}
void TokenService::Initialize(const char* const source,
@@ -81,7 +81,7 @@ void TokenService::Initialize(const char* const source,
getter_ = profile->GetRequestContext();
// Since the user can create a bookmark in incognito, sync may be running.
// Thus we have to go for explicit access.
- web_data_service_ = WebDataService::FromBrowserContext(profile);
+ token_web_data_ = TokenWebData::FromBrowserContext(profile);
source_ = std::string(source);
CommandLine* cmd_line = CommandLine::ForCurrentProcess();
@@ -140,7 +140,7 @@ void TokenService::ResetCredentialsInMemory() {
// Cancel pending loads. Callbacks will not return.
if (token_loading_query_) {
- web_data_service_->CancelRequest(token_loading_query_);
+ token_web_data_->CancelRequest(token_loading_query_);
token_loading_query_ = 0;
}
@@ -175,21 +175,21 @@ void TokenService::UpdateCredentialsWithOAuth2(
void TokenService::LoadTokensFromDB() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (web_data_service_.get())
- token_loading_query_ = web_data_service_->GetAllTokens(this);
+ 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 (web_data_service_.get())
- web_data_service_->SetTokenForService(service, auth_token);
+ if (token_web_data_.get())
+ token_web_data_->SetTokenForService(service, auth_token);
}
void TokenService::EraseTokensFromDB() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (web_data_service_.get())
- web_data_service_->RemoveAllTokens();
+ if (token_web_data_.get())
+ token_web_data_->RemoveAllTokens();
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_TOKENS_CLEARED,
@@ -363,7 +363,7 @@ void TokenService::OnClientOAuthFailure(
GaiaConstants::kGaiaOAuth2LoginRefreshToken, error);
}
-void TokenService::OnWebDataServiceRequestDone(WebDataService::Handle h,
+void TokenService::OnWebDataServiceRequestDone(WebDataServiceBase::Handle h,
const WDTypedResult* result) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(token_loading_query_);
« no previous file with comments | « chrome/browser/signin/token_service.h ('k') | chrome/browser/signin/token_service_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698