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

Unified Diff: components/gcm_driver/gcm_driver.h

Issue 1126233004: Persist Instance ID data to GCM store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mac Created 5 years, 7 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
« no previous file with comments | « components/gcm_driver/gcm_client_impl.cc ('k') | components/gcm_driver/gcm_driver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_driver.h
diff --git a/components/gcm_driver/gcm_driver.h b/components/gcm_driver/gcm_driver.h
index fb20f3ac3af6435e31771301fcb296c98f15d9ce..aac0975fbd351c0eb605c354ec73b702e59726ec 100644
--- a/components/gcm_driver/gcm_driver.h
+++ b/components/gcm_driver/gcm_driver.h
@@ -22,6 +22,26 @@ class GCMAppHandler;
class GCMConnectionObserver;
struct AccountMapping;
+// Provides the capability to set/get InstanceID data in the GCM store.
+class InstanceIDStore {
+ public:
+ typedef base::Callback<void(const std::string& instance_id_data)>
+ GetInstanceIDDataCallback;
+
+ InstanceIDStore();
+ virtual ~InstanceIDStore();
+
+ virtual void AddInstanceIDData(const std::string& app_id,
+ const std::string& instance_id_data) = 0;
+ virtual void RemoveInstanceIDData(const std::string& app_id) = 0;
+ virtual void GetInstanceIDData(
+ const std::string& app_id,
+ const GetInstanceIDDataCallback& callback) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(InstanceIDStore);
+};
+
// Bridge between GCM users in Chrome and the platform-specific implementation.
class GCMDriver {
public:
@@ -146,6 +166,9 @@ class GCMDriver {
// to send a heartbeat message.
virtual void WakeFromSuspendForHeartbeat(bool wake) = 0;
+ // Supports saving the Instance ID data in the GCM store.
+ virtual InstanceIDStore* GetInstanceIDStore() = 0;
+
protected:
// Ensures that the GCM service starts (if necessary conditions are met).
virtual GCMClient::Result EnsureStarted(GCMClient::StartMode start_mode) = 0;
« no previous file with comments | « components/gcm_driver/gcm_client_impl.cc ('k') | components/gcm_driver/gcm_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698