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

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

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/profile_keyed_service_factory.h
diff --git a/chrome/browser/profiles/profile_keyed_service_factory.h b/chrome/browser/profiles/profile_keyed_service_factory.h
index 0cfa841e1a572610208003fb201551f18c852291..3c0ef39a7f99d73882c5a8ee40fcdfdb11c5cbb2 100644
--- a/chrome/browser/profiles/profile_keyed_service_factory.h
+++ b/chrome/browser/profiles/profile_keyed_service_factory.h
@@ -29,18 +29,18 @@ class ProfileKeyedServiceFactory : public ProfileKeyedBaseFactory {
// A function that supplies the instance of a ProfileKeyedService for a given
// Profile. This is used primarily for testing, where we want to feed a
// specific mock into the PKSF system.
- typedef ProfileKeyedService* (*FactoryFunction)(Profile* profile);
+ typedef ProfileKeyedService* (*FactoryFunction)(content::BrowserContext* profile);
// Associates |factory| with |profile| so that |factory| is used to create
// the ProfileKeyedService when requested. |factory| can be NULL to signal
// that ProfileKeyedService should be NULL. Multiple calls to
// SetTestingFactory() are allowed; previous services will be shut down.
- void SetTestingFactory(Profile* profile, FactoryFunction factory);
+ void SetTestingFactory(content::BrowserContext* profile, FactoryFunction factory);
// Associates |factory| with |profile| and immediately returns the created
// ProfileKeyedService. Since the factory will be used immediately, it may
// not be NULL.
- ProfileKeyedService* SetTestingFactoryAndUse(Profile* profile,
+ ProfileKeyedService* SetTestingFactoryAndUse(content::BrowserContext* profile,
FactoryFunction factory);
protected:
@@ -63,15 +63,15 @@ class ProfileKeyedServiceFactory : public ProfileKeyedBaseFactory {
// through the GetProfileToUse() method on the base. If |create| is true,
// the service will be created using BuildServiceInstanceFor() if it doesn't
// already exist.
- ProfileKeyedService* GetServiceForProfile(Profile* profile, bool create);
+ ProfileKeyedService* GetServiceForProfile(content::BrowserContext* profile, bool create);
// Maps |profile| to |service| with debug checks to prevent duplication.
- void Associate(Profile* profile, ProfileKeyedService* service);
+ void Associate(content::BrowserContext* profile, ProfileKeyedService* service);
// All subclasses of ProfileKeyedServiceFactory must return a
// ProfileKeyedService instead of just a ProfileKeyedBase.
virtual ProfileKeyedService* BuildServiceInstanceFor(
- Profile* profile) const = 0;
+ content::BrowserContext* profile) const = 0;
// A helper object actually listens for notifications about Profile
// destruction, calculates the order in which things are destroyed and then
@@ -84,24 +84,24 @@ class ProfileKeyedServiceFactory : public ProfileKeyedBaseFactory {
//
// Secondly, ProfileDestroyed() is called on every ServiceFactory and the
// default implementation removes it from |mapping_| and deletes the pointer.
- virtual void ProfileShutdown(Profile* profile) OVERRIDE;
- virtual void ProfileDestroyed(Profile* profile) OVERRIDE;
+ virtual void ProfileShutdown(content::BrowserContext* profile) OVERRIDE;
+ virtual void ProfileDestroyed(content::BrowserContext* profile) OVERRIDE;
- virtual void SetEmptyTestingFactory(Profile* profile) OVERRIDE;
- virtual void CreateServiceNow(Profile* profile) OVERRIDE;
+ virtual void SetEmptyTestingFactory(content::BrowserContext* profile) OVERRIDE;
+ virtual void CreateServiceNow(content::BrowserContext* profile) OVERRIDE;
private:
friend class ProfileDependencyManager;
friend class ProfileDependencyManagerUnittests;
- typedef std::map<Profile*, ProfileKeyedService*> ProfileKeyedServices;
- typedef std::map<Profile*, FactoryFunction> ProfileOverriddenFunctions;
+ typedef std::map<content::BrowserContext*, ProfileKeyedService*> ProfileKeyedServices;
+ typedef std::map<content::BrowserContext*, FactoryFunction> ProfileOverriddenFunctions;
// The mapping between a Profile and its service.
- std::map<Profile*, ProfileKeyedService*> mapping_;
+ std::map<content::BrowserContext*, ProfileKeyedService*> mapping_;
// The mapping between a Profile and its overridden FactoryFunction.
- std::map<Profile*, FactoryFunction> factories_;
+ std::map<content::BrowserContext*, FactoryFunction> factories_;
DISALLOW_COPY_AND_ASSIGN(ProfileKeyedServiceFactory);
};

Powered by Google App Engine
This is Rietveld 408576698