OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_FACTORY_H_ |
| 6 #define COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_FACTORY_H_ |
| 7 |
| 8 #include <memory> |
| 9 #include <string> |
| 10 |
| 11 namespace gcm { |
| 12 class GCMDriver; |
| 13 } |
| 14 |
| 15 namespace instance_id { |
| 16 |
| 17 class InstanceID; |
| 18 |
| 19 class InstanceIDFactory { |
| 20 public: |
| 21 virtual ~InstanceIDFactory() = default; |
| 22 |
| 23 // Creates a new instance of InstanceID. The testing code could override this |
| 24 // to provide a mocked instance. |
| 25 // |app_id|: identifies the application that uses the Instance ID. |
| 26 // |handler|: provides the GCM functionality needed to support Instance ID. |
| 27 // Must outlive this class. On Android, this can be null instead. |
| 28 virtual std::unique_ptr<InstanceID> Create(const std::string& app_id, |
| 29 gcm::GCMDriver* gcm_driver) = 0; |
| 30 }; |
| 31 |
| 32 } // namespace instance_id |
| 33 |
| 34 #endif // COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_FACTORY_H_ |
OLD | NEW |