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

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

Issue 2111973002: Add support for GCM subtypes to desktop Instance ID implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid9push
Patch Set: address most of peter's concerns Created 4 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_driver.h
diff --git a/components/gcm_driver/instance_id/instance_id_driver.h b/components/gcm_driver/instance_id/instance_id_driver.h
index 38e1e6224b93c61c654b6b376b95d055daccb36e..a55a831a992d869024370b7a7d095aeb58cdd7d8 100644
--- a/components/gcm_driver/instance_id/instance_id_driver.h
+++ b/components/gcm_driver/instance_id/instance_id_driver.h
@@ -30,9 +30,17 @@ class InstanceIDDriver {
virtual ~InstanceIDDriver();
// Returns the InstanceID that provides the Instance ID service for the given
- // application. The lifetime of InstanceID will be managed by this class.
+ // application. The lifetime of the InstanceID will be managed by this class.
InstanceID* GetInstanceID(const std::string& app_id);
+ // Like |GetInstanceID|, except that for historical reasons, Chrome Apps and
+ // Extensions send the |app_id| to GCM as a "category" instead of a "subtype".
+ // Not recommended for new code, since this does not (and cannot) support
+ // Android, and switching between this and |GetInstanceID| is not supported (a
+ // given |app_id| must either always use |GetInstanceID| or always use
+ // |GetInstanceIDForExtensions|, even across Chrome versions).
+ InstanceID* GetInstanceIDForExtensions(const std::string& app_id);
+
// Removes the InstanceID when it is not longer needed, i.e. the app is being
// uninstalled.
void RemoveInstanceID(const std::string& app_id);
@@ -42,6 +50,8 @@ class InstanceIDDriver {
bool ExistsInstanceID(const std::string& app_id) const;
private:
+ InstanceID* GetInstanceID(const std::string& app_id, bool use_subtype);
+
// Owned by GCMProfileServiceFactory, which is a dependency of
// InstanceIDProfileServiceFactory, which owns this.
gcm::GCMDriver* gcm_driver_;

Powered by Google App Engine
This is Rietveld 408576698