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

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

Issue 12805007: wd5-syncableServices for try only (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wd5-syncableServices with debug test fix 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
« no previous file with comments | « chrome/browser/webdata/web_data_service_base.cc ('k') | chrome/browser/webdata/web_data_service_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..153a41fd85783dd33d6fcb5e7d482d65c791fa89 100644
--- a/chrome/browser/webdata/web_data_service_factory.h
+++ b/chrome/browser/webdata/web_data_service_factory.h
@@ -6,13 +6,36 @@
#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"
-class WebDataService;
+// A wrapper of WebDataService so that we can use it as a profile keyed service.
+class WebDataServiceWrapper : public ProfileKeyedService {
+ public:
+ explicit WebDataServiceWrapper(Profile* profile);
+
+ // For testing.
+ WebDataServiceWrapper();
+
+ virtual ~WebDataServiceWrapper();
+
+ // ProfileKeyedService:
+ virtual void Shutdown() OVERRIDE;
+
+ virtual scoped_refptr<WebDataService> GetWebData();
-class WebDataServiceFactory : public RefcountedProfileKeyedServiceFactory {
+ private:
+ scoped_refptr<WebDataService> web_data_service_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebDataServiceWrapper);
+};
+
+// Singleton that owns all WebDataServiceWrappers and associates them with
+// Profiles.
+class WebDataServiceFactory : public ProfileKeyedServiceFactory {
public:
// Returns the |WebDataService| associated with the |profile|.
// |access_type| is either EXPLICIT_ACCESS or IMPLICIT_ACCESS
@@ -33,9 +56,11 @@ 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;
+
+ DISALLOW_COPY_AND_ASSIGN(WebDataServiceFactory);
};
#endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_FACTORY_H__
« no previous file with comments | « chrome/browser/webdata/web_data_service_base.cc ('k') | chrome/browser/webdata/web_data_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698