Index: chrome/browser/invalidation/invalidation_service_factory.h |
diff --git a/chrome/browser/invalidation/invalidation_service_factory.h b/chrome/browser/invalidation/invalidation_service_factory.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..71a7a61c6f5463e459588cc80a35a5e0f024d2a1 |
--- /dev/null |
+++ b/chrome/browser/invalidation/invalidation_service_factory.h |
@@ -0,0 +1,55 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_FACTORY_H_ |
+#define CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_FACTORY_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/memory/singleton.h" |
+#include "chrome/browser/profiles/profile_keyed_service_factory.h" |
+ |
+namespace syncer { |
+class Invalidator; |
+} |
+ |
+class InvalidationFrontend; |
+class Profile; |
+ |
+namespace invalidation { |
+ |
+// A ProfileKeyedServiceFactory to construct InvalidationServices. The |
+// implementation of the InvalidationService may be completely different on |
+// different platforms; this class should help to hide this complexity. It also |
+// exposes some factory methods that are useful for setting up tests that rely |
+// on invalidations. |
+class InvalidationServiceFactory : public ProfileKeyedServiceFactory { |
+ public: |
tim (not reviewing)
2013/05/03 17:48:23
nit- one space indent for public: / private:
rlarocque
2013/05/03 22:16:14
Done.
|
+ // TODO(rlarocque): Re-enable this once InvalidationFrontend can extend |
rlarocque
2013/04/24 20:26:15
These TODOs will be fixed in the next patch in thi
|
+ // ProfileKeyedService. |
+ // static InvalidationFrontend* GetForProfile(Profile* profile); |
+ |
+ static InvalidationServiceFactory* GetInstance(); |
+ |
+ static ProfileKeyedService* BuildP2PInvalidationServiceFor(Profile* profile); |
+ static ProfileKeyedService* BuildTestServiceInstanceFor(Profile* profile); |
+ |
+ private: |
+ friend struct DefaultSingletonTraits<InvalidationServiceFactory>; |
+ |
+ InvalidationServiceFactory(); |
+ virtual ~InvalidationServiceFactory(); |
+ |
+ // ProfileKeyedServiceFactory: |
+ virtual ProfileKeyedService* BuildServiceInstanceFor( |
+ Profile* profile) const OVERRIDE; |
+ // TODO(rlarocque): Use this class, not InvalidatorStorage, to register |
tim (not reviewing)
2013/05/03 17:48:23
Use what class? The function?
rlarocque
2013/05/03 22:16:14
In chrome/browser/prefs/browser_prefs.cc, Register
|
+ // for user prefs. |
+ // virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(InvalidationServiceFactory); |
+}; |
+ |
+} // namespace invalidation |
+ |
+#endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_FACTORY_H_ |