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

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

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_base_factory.h
diff --git a/chrome/browser/profiles/profile_keyed_base_factory.h b/chrome/browser/profiles/profile_keyed_base_factory.h
index 0b5ee1b0eb428459257e5840a472af889ef5495e..92401d0a9797b929ac25a9f89d84d19a222a2bf6 100644
--- a/chrome/browser/profiles/profile_keyed_base_factory.h
+++ b/chrome/browser/profiles/profile_keyed_base_factory.h
@@ -10,11 +10,16 @@
#include "base/threading/non_thread_safe.h"
#include "chrome/browser/profiles/dependency_node.h"
+namespace content {
+class BrowserContext;
+};
+
class PrefRegistrySyncable;
class PrefService;
-class Profile;
class ProfileDependencyManager;
+class Profile;
+
// Base class for Factories that take a Profile object and return some service.
//
// Unless you're trying to make a new type of Factory, you probably don't want
@@ -29,7 +34,7 @@ class ProfileKeyedBaseFactory : public base::NonThreadSafe,
// |profile|. This is the public interface and is safe to be called multiple
// times because testing code can have multiple services of the same type
// attached to a single |profile|.
- void RegisterUserPrefsOnProfile(Profile* profile);
+ void RegisterUserPrefsOnProfile(content::BrowserContext* profile);
#ifndef NDEBUG
// Returns our name. We don't keep track of this in release mode.
@@ -46,7 +51,7 @@ class ProfileKeyedBaseFactory : public base::NonThreadSafe,
void DependsOn(ProfileKeyedBaseFactory* rhs);
// Finds which profile (if any) to use using the Service.*Incognito methods.
- Profile* GetProfileToUse(Profile* profile);
+ content::BrowserContext* GetProfileToUse(content::BrowserContext* profile);
// Interface for people building a concrete FooServiceFactory: --------------
@@ -91,14 +96,14 @@ class ProfileKeyedBaseFactory : public base::NonThreadSafe,
// should delete/deref/do other final memory management things during this
// phase. You must also call the base class method as the last thing you
// do.
- virtual void ProfileShutdown(Profile* profile) = 0;
- virtual void ProfileDestroyed(Profile* profile);
+ virtual void ProfileShutdown(content::BrowserContext* profile) = 0;
+ virtual void ProfileDestroyed(content::BrowserContext* profile);
// Returns whether we've registered the preferences on this profile.
- bool ArePreferencesSetOn(Profile* profile) const;
+ bool ArePreferencesSetOn(content::BrowserContext* profile) const;
// Mark profile as Preferences set.
- void MarkPreferencesSetOn(Profile* profile);
+ void MarkPreferencesSetOn(content::BrowserContext* profile);
private:
friend class ProfileDependencyManager;
@@ -109,11 +114,11 @@ class ProfileKeyedBaseFactory : public base::NonThreadSafe,
// Because of ServiceIsNULLWhileTesting(), we need a way to tell different
// subclasses that they should disable testing.
- virtual void SetEmptyTestingFactory(Profile* profile) = 0;
+ virtual void SetEmptyTestingFactory(content::BrowserContext* profile) = 0;
// We also need a generalized, non-returning method that generates the object
// now for when we're creating the profile.
- virtual void CreateServiceNow(Profile* profile) = 0;
+ virtual void CreateServiceNow(content::BrowserContext* profile) = 0;
// Which ProfileDependencyManager we should communicate with. In real code,
// this will always be ProfileDependencyManager::GetInstance(), but unit
@@ -121,7 +126,7 @@ class ProfileKeyedBaseFactory : public base::NonThreadSafe,
ProfileDependencyManager* dependency_manager_;
// Profiles that have this service's preferences registered on them.
- std::set<Profile*> registered_preferences_;
+ std::set<content::BrowserContext*> registered_preferences_;
#if !defined(NDEBUG)
// A static string passed in to our constructor. Should be unique across all
« no previous file with comments | « chrome/browser/profiles/profile_dependency_manager_unittest.cc ('k') | chrome/browser/profiles/profile_keyed_base_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698