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

Unified Diff: chrome/test/base/testing_profile.cc

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review Created 7 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
Index: chrome/test/base/testing_profile.cc
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index 92e128693818c64e5c4fefa1a5d13f17dc462ffd..268ef0f873d4f0944f5d72421e57959a721534ce 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -141,9 +141,10 @@ class TestExtensionURLRequestContextGetter
scoped_ptr<net::URLRequestContext> context_;
};
-ProfileKeyedService* CreateTestDesktopNotificationService(Profile* profile) {
+ProfileKeyedService* CreateTestDesktopNotificationService(
+ content::BrowserContext* profile) {
#if defined(ENABLE_NOTIFICATIONS)
- return new DesktopNotificationService(profile, NULL);
+ return new DesktopNotificationService(static_cast<Profile*>(profile), NULL);
#else
return NULL;
#endif
@@ -315,9 +316,11 @@ TestingProfile::~TestingProfile() {
pref_proxy_config_tracker_->DetachFromPrefService();
}
-static ProfileKeyedService* BuildFaviconService(Profile* profile) {
+static ProfileKeyedService* BuildFaviconService(
+ content::BrowserContext* profile) {
return new FaviconService(
- HistoryServiceFactory::GetForProfileWithoutCreating(profile));
+ HistoryServiceFactory::GetForProfileWithoutCreating(
+ static_cast<Profile*>(profile)));
}
void TestingProfile::CreateFaviconService() {
@@ -326,8 +329,9 @@ void TestingProfile::CreateFaviconService() {
this, BuildFaviconService);
}
-static ProfileKeyedService* BuildHistoryService(Profile* profile) {
- return new HistoryService(profile);
+static ProfileKeyedService* BuildHistoryService(
+ content::BrowserContext* profile) {
+ return new HistoryService(static_cast<Profile*>(profile));
}
void TestingProfile::CreateHistoryService(bool delete_file, bool no_db) {
@@ -390,7 +394,9 @@ void TestingProfile::DestroyTopSites() {
}
}
-static ProfileKeyedService* BuildBookmarkModel(Profile* profile) {
+static ProfileKeyedService* BuildBookmarkModel(
+ content::BrowserContext* context) {
+ Profile* profile = static_cast<Profile*>(context);
BookmarkModel* bookmark_model = new BookmarkModel(profile);
bookmark_model->Load(profile->GetIOTaskRunner());
return bookmark_model;
@@ -417,8 +423,8 @@ void TestingProfile::CreateBookmarkModel(bool delete_file) {
}
static ProfileKeyedService* BuildWebDataService(
- Profile* profile) {
- return new WebDataServiceWrapper(profile);
+ content::BrowserContext* profile) {
+ return new WebDataServiceWrapper(static_cast<Profile*>(profile));
}
void TestingProfile::CreateWebDataService() {

Powered by Google App Engine
This is Rietveld 408576698