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

Unified Diff: chrome/browser/profiles/refcounted_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: 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/refcounted_profile_keyed_service_factory.cc
diff --git a/chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc b/chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc
index ad29ec28c5b329c6db6806c761f3b72b8c83ee25..e2e74ba8b3d817f1aabc202a1aea3d97d6f9a9dc 100644
--- a/chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc
+++ b/chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc
@@ -11,7 +11,7 @@
#include "chrome/browser/profiles/refcounted_profile_keyed_service.h"
void RefcountedProfileKeyedServiceFactory::SetTestingFactory(
- Profile* profile,
+ 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
@@ -33,7 +33,7 @@ void RefcountedProfileKeyedServiceFactory::SetTestingFactory(
scoped_refptr<RefcountedProfileKeyedService>
RefcountedProfileKeyedServiceFactory::SetTestingFactoryAndUse(
- Profile* profile,
+ content::BrowserContext* profile,
FactoryFunction factory) {
DCHECK(factory);
SetTestingFactory(profile, factory);
@@ -52,11 +52,12 @@ RefcountedProfileKeyedServiceFactory::~RefcountedProfileKeyedServiceFactory() {
scoped_refptr<RefcountedProfileKeyedService>
RefcountedProfileKeyedServiceFactory::GetServiceForProfile(
- Profile* profile,
+ content::BrowserContext* profile,
bool create) {
- profile = GetProfileToUse(profile);
- if (!profile)
- return NULL;
+ // TODO(phajdan.jr): Figure out the next steps here.
+ // profile = GetProfileToUse(profile);
+ // if (!profile)
+ // return NULL;
// NOTE: If you modify any of the logic below, make sure to update the
// non-refcounted version in profile_keyed_service_factory.cc!
@@ -88,19 +89,19 @@ RefcountedProfileKeyedServiceFactory::GetServiceForProfile(
}
void RefcountedProfileKeyedServiceFactory::Associate(
- Profile* profile,
+ content::BrowserContext* profile,
const scoped_refptr<RefcountedProfileKeyedService>& service) {
DCHECK(!ContainsKey(mapping_, profile));
mapping_.insert(std::make_pair(profile, service));
}
-void RefcountedProfileKeyedServiceFactory::ProfileShutdown(Profile* profile) {
+void RefcountedProfileKeyedServiceFactory::ProfileShutdown(content::BrowserContext* profile) {
RefCountedStorage::iterator it = mapping_.find(profile);
if (it != mapping_.end() && it->second)
it->second->ShutdownOnUIThread();
}
-void RefcountedProfileKeyedServiceFactory::ProfileDestroyed(Profile* profile) {
+void RefcountedProfileKeyedServiceFactory::ProfileDestroyed(content::BrowserContext* profile) {
// We "merely" drop our reference to the service. Hopefully this will cause
// the service to be destroyed. If not, oh well.
mapping_.erase(profile);
@@ -115,10 +116,10 @@ void RefcountedProfileKeyedServiceFactory::ProfileDestroyed(Profile* profile) {
}
void RefcountedProfileKeyedServiceFactory::SetEmptyTestingFactory(
- Profile* profile) {
+ content::BrowserContext* profile) {
SetTestingFactory(profile, NULL);
}
-void RefcountedProfileKeyedServiceFactory::CreateServiceNow(Profile* profile) {
+void RefcountedProfileKeyedServiceFactory::CreateServiceNow(content::BrowserContext* profile) {
GetServiceForProfile(profile, true);
}

Powered by Google App Engine
This is Rietveld 408576698