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

Unified Diff: chrome/browser/webdata/web_data_service_factory.h

Issue 12491017: Make WebDataService no longer depend on ProfileKeyedService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean-up Created 7 years, 9 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/webdata/web_data_service_factory.h
diff --git a/chrome/browser/webdata/web_data_service_factory.h b/chrome/browser/webdata/web_data_service_factory.h
index fe4ef6b14b66421693ae3cdf9a9c678732276a79..9140fe65ab8dae9c498619c9a6d657fd1a7cee60 100644
--- a/chrome/browser/webdata/web_data_service_factory.h
+++ b/chrome/browser/webdata/web_data_service_factory.h
@@ -6,13 +6,37 @@
#define CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_FACTORY_H__
#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/singleton.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/profiles/refcounted_profile_keyed_service_factory.h"
+#include "chrome/browser/profiles/profile_keyed_service_factory.h"
+#include "chrome/browser/webdata/web_data_service.h"
+
+// A wrapper of WebDataService so that we can use it as a profile keyed service.
+class WebDataServiceWrapper : public ProfileKeyedService {
+ public:
+ WebDataServiceWrapper(Profile* profile);
+
+ // For testing.
+ WebDataServiceWrapper() {};
+
+ virtual ~WebDataServiceWrapper();
+
+ // ProfileKeyedService:
+ virtual void Shutdown() OVERRIDE;
+
+ virtual scoped_refptr<WebDataService> GetWebData();
+
+ private:
+ scoped_refptr<WebDataService> web_data_service_;
+};
dhollowa 2013/03/18 18:50:59 DISALLOW_COPY_AND_ASSIGN
Cait (Slow) 2013/03/18 19:10:35 Done.
-class WebDataService;
-class WebDataServiceFactory : public RefcountedProfileKeyedServiceFactory {
+// Singleton that owns all PersonalDataManagers and associates them with
+// Profiles.
+// Listens for the Profile's destruction notification and cleans up the
+// associated PersonalDataManager.
+class WebDataServiceFactory : public ProfileKeyedServiceFactory {
public:
// Returns the |WebDataService| associated with the |profile|.
// |access_type| is either EXPLICIT_ACCESS or IMPLICIT_ACCESS
@@ -33,7 +57,7 @@ class WebDataServiceFactory : public RefcountedProfileKeyedServiceFactory {
// |ProfileKeyedBaseFactory| methods:
virtual bool ServiceRedirectedInIncognito() const OVERRIDE;
- virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor(
+ virtual ProfileKeyedService* BuildServiceInstanceFor(
Profile* profile) const OVERRIDE;
virtual bool ServiceIsNULLWhileTesting() const OVERRIDE;
dhollowa 2013/03/18 18:50:59 DISALLOW_COPY_AND_ASSIGN
Cait (Slow) 2013/03/18 19:10:35 Done.
};

Powered by Google App Engine
This is Rietveld 408576698