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

Unified Diff: components/gcm_driver/instance_id/instance_id_factory.h

Issue 2847923002: [Chromecast] Add method to CastCdm for the session expiration updating. (Closed)
Patch Set: Add InstanceIDFactory class to help with testing. Created 3 years, 5 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: components/gcm_driver/instance_id/instance_id_factory.h
diff --git a/components/gcm_driver/instance_id/instance_id_factory.h b/components/gcm_driver/instance_id/instance_id_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..7c4161f8da50faff2ba439310dcdfe58eb6853ca
--- /dev/null
+++ b/components/gcm_driver/instance_id/instance_id_factory.h
@@ -0,0 +1,34 @@
+// Copyright 2017 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 COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_FACTORY_H_
+#define COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_FACTORY_H_
+
+#include <memory>
+#include <string>
+
+namespace gcm {
+class GCMDriver;
+}
+
+namespace instance_id {
+
+class InstanceID;
+
+class InstanceIDFactory {
+ public:
+ virtual ~InstanceIDFactory() = default;
+
+ // Creates a new instance of InstanceID. The testing code could override this
+ // to provide a mocked instance.
+ // |app_id|: identifies the application that uses the Instance ID.
+ // |handler|: provides the GCM functionality needed to support Instance ID.
+ // Must outlive this class. On Android, this can be null instead.
+ virtual std::unique_ptr<InstanceID> Create(const std::string& app_id,
+ gcm::GCMDriver* gcm_driver) = 0;
+};
+
+} // namespace instance_id
+
+#endif // COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698