Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / services / gcm / gcm_client_factory.h
index e2914f0..9112399 100644 (file)
@@ -6,11 +6,7 @@
 #define CHROME_BROWSER_SERVICES_GCM_GCM_CLIENT_FACTORY_H_
 
 #include "base/macros.h"
-#include "base/memory/ref_counted.h"
-
-namespace net {
-class URLRequestContextGetter;
-}
+#include "base/memory/scoped_ptr.h"
 
 namespace gcm {
 
@@ -18,22 +14,14 @@ class GCMClient;
 
 class GCMClientFactory {
  public:
-  // Creates the single instance of GCMClient if not yet created.
-  // Called on UI thread.
-  static void  BuildClientFromUI();
-
-  // Returns a single instance of GCMClient.
-  // This should be called on IO thread.
-  static GCMClient* GetClient();
+  GCMClientFactory();
+  virtual ~GCMClientFactory();
 
-  // Passes a mocked instance for testing purpose.
-  typedef GCMClient* (*TestingFactoryFunction)();
-  static void SetTestingFactory(TestingFactoryFunction factory);
+  // Creates a new instance of GCMClient. The testing code could override this
+  // to provide a mocked instance.
+  virtual scoped_ptr<GCMClient> BuildInstance();
 
  private:
-  GCMClientFactory();
-  ~GCMClientFactory();
-
   DISALLOW_COPY_AND_ASSIGN(GCMClientFactory);
 };