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

Unified Diff: chrome/browser/profiles/profile_keyed_service_factory.cc

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybots 2 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/browser/profiles/profile_keyed_service_factory.cc
diff --git a/chrome/browser/profiles/profile_keyed_service_factory.cc b/chrome/browser/profiles/profile_keyed_service_factory.cc
index d3ee4a547822849247be406f702d6cff646e780f..dd74146e89eeff33a16ab2f0608918756d6869b1 100644
--- a/chrome/browser/profiles/profile_keyed_service_factory.cc
+++ b/chrome/browser/profiles/profile_keyed_service_factory.cc
@@ -12,8 +12,8 @@
#include "chrome/browser/profiles/profile_dependency_manager.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
-void ProfileKeyedServiceFactory::SetTestingFactory(Profile* profile,
- FactoryFunction factory) {
+void ProfileKeyedServiceFactory::SetTestingFactory(
+ content::BrowserContext* profile, FactoryFunction factory) {
// Destroying the profile may cause us to lose data about whether |profile|
// has our preferences registered on it (since the profile object itself
// isn't dead). See if we need to readd it once we've gone through normal
@@ -33,7 +33,7 @@ void ProfileKeyedServiceFactory::SetTestingFactory(Profile* profile,
}
ProfileKeyedService* ProfileKeyedServiceFactory::SetTestingFactoryAndUse(
- Profile* profile,
+ content::BrowserContext* profile,
FactoryFunction factory) {
DCHECK(factory);
SetTestingFactory(profile, factory);
@@ -50,7 +50,7 @@ ProfileKeyedServiceFactory::~ProfileKeyedServiceFactory() {
}
ProfileKeyedService* ProfileKeyedServiceFactory::GetServiceForProfile(
- Profile* profile,
+ content::BrowserContext* profile,
bool create) {
profile = GetProfileToUse(profile);
if (!profile)
@@ -85,19 +85,21 @@ ProfileKeyedService* ProfileKeyedServiceFactory::GetServiceForProfile(
return service;
}
-void ProfileKeyedServiceFactory::Associate(Profile* profile,
+void ProfileKeyedServiceFactory::Associate(content::BrowserContext* profile,
ProfileKeyedService* service) {
DCHECK(!ContainsKey(mapping_, profile));
mapping_.insert(std::make_pair(profile, service));
}
-void ProfileKeyedServiceFactory::ProfileShutdown(Profile* profile) {
+void ProfileKeyedServiceFactory::ProfileShutdown(
+ content::BrowserContext* profile) {
ProfileKeyedServices::iterator it = mapping_.find(profile);
if (it != mapping_.end() && it->second)
it->second->Shutdown();
}
-void ProfileKeyedServiceFactory::ProfileDestroyed(Profile* profile) {
+void ProfileKeyedServiceFactory::ProfileDestroyed(
+ content::BrowserContext* profile) {
ProfileKeyedServices::iterator it = mapping_.find(profile);
if (it != mapping_.end()) {
delete it->second;
@@ -114,10 +116,11 @@ void ProfileKeyedServiceFactory::ProfileDestroyed(Profile* profile) {
}
void ProfileKeyedServiceFactory::SetEmptyTestingFactory(
- Profile* profile) {
+ content::BrowserContext* profile) {
SetTestingFactory(profile, NULL);
}
-void ProfileKeyedServiceFactory::CreateServiceNow(Profile* profile) {
+void ProfileKeyedServiceFactory::CreateServiceNow(
+ content::BrowserContext* profile) {
GetServiceForProfile(profile, true);
}

Powered by Google App Engine
This is Rietveld 408576698