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

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

Issue 1785613006: Make GCMDriver::GetInstanceIDHandler protected, to avoid misuse (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address peter's nits Created 4 years, 9 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.h
diff --git a/components/gcm_driver/instance_id/instance_id.h b/components/gcm_driver/instance_id/instance_id.h
index 9adf0e5def2604150b45e9a3f99fdbe5614cc9ee..fb69a11ef7776187fd5b9695521b8d55a355c3ea 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 {
@@ -56,10 +56,10 @@ class InstanceID {
// Creator.
// |app_id|: identifies the application that uses the Instance ID.
- // |gcm_driver|: driver to access the GCM functionalities needed to support
- // Instance ID.
+ // |handler|: provides the GCM functionality needed to support Instance ID.
+ // 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,17 @@ 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() const { return handler_; }
+
private:
+ // Owned by GCMProfileServiceFactory, which is a dependency of
+ // InstanceIDProfileServiceFactory, which owns this.
+ gcm::InstanceIDHandler* handler_;
+
std::string app_id_;
TokenRefreshCallback token_refresh_callback_;
« no previous file with comments | « components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.cc ('k') | components/gcm_driver/instance_id/instance_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698