Index: components/gcm_driver/instance_id/instance_id.h |
diff --git a/components/gcm_driver/instance_id/instance_id.h b/components/gcm_driver/instance_id/instance_id.h |
index 9adf0e5def2604150b45e9a3f99fdbe5614cc9ee..865f3bb0dce58cd4bc703e82c0d98efe724c5613 100644 |
--- a/components/gcm_driver/instance_id/instance_id.h |
+++ b/components/gcm_driver/instance_id/instance_id.h |
@@ -14,7 +14,7 @@ |
#include "base/time/time.h" |
namespace gcm { |
-class GCMDriver; |
+class InstanceIDHandler; |
} // namespace gcm |
namespace instance_id { |
@@ -57,9 +57,9 @@ class InstanceID { |
// Creator. |
// |app_id|: identifies the application that uses the Instance ID. |
// |gcm_driver|: driver to access the GCM functionalities needed to support |
Peter Beverloo
2016/03/11 16:10:19
Please update this comment.
johnme
2016/03/11 17:53:23
Done.
|
- // Instance ID. |
+ // Instance ID. Its InstanceIDHandler must outlive this class. |
static scoped_ptr<InstanceID> Create(const std::string& app_id, |
- gcm::GCMDriver* gcm_driver); |
+ gcm::InstanceIDHandler* handler); |
virtual ~InstanceID(); |
@@ -106,11 +106,14 @@ class InstanceID { |
std::string app_id() const { return app_id_; } |
protected: |
- explicit InstanceID(const std::string& app_id); |
+ InstanceID(const std::string& app_id, gcm::InstanceIDHandler* handler); |
void NotifyTokenRefresh(bool update_id); |
+ gcm::InstanceIDHandler* handler() { return handler_; } |
Peter Beverloo
2016/03/11 16:10:19
Can this be const? (Like the method you're replaci
johnme
2016/03/11 17:53:22
Done.
|
+ |
private: |
+ gcm::InstanceIDHandler* handler_; // Not owned. |
Peter Beverloo
2016/03/11 16:10:19
Personally I would prefer documenting *why* it's s
johnme
2016/03/11 17:53:23
Done: "
// Owned by GCMProfileServiceFactory, whic
|
std::string app_id_; |
TokenRefreshCallback token_refresh_callback_; |