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

Unified Diff: components/gcm_driver/gcm_driver_desktop.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_driver_android.cc ('k') | components/gcm_driver/gcm_driver_desktop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_driver_desktop.h
diff --git a/components/gcm_driver/gcm_driver_desktop.h b/components/gcm_driver/gcm_driver_desktop.h
index 422f0f5116d10b220141d34d3e8a7e09802ce034..f52dd6bbacbe5efd53100ecfa057cd9f8ecd02b7 100644
--- a/components/gcm_driver/gcm_driver_desktop.h
+++ b/components/gcm_driver/gcm_driver_desktop.h
@@ -43,7 +43,8 @@ class GCMClientFactory;
class GCMDelayedTaskController;
// GCMDriver implementation for desktop and Chrome OS, using GCMClient.
-class GCMDriverDesktop : public GCMDriver {
+class GCMDriverDesktop : public GCMDriver,
+ public InstanceIDStore {
public:
GCMDriverDesktop(
scoped_ptr<GCMClientFactory> gcm_client_factory,
@@ -83,6 +84,14 @@ class GCMDriverDesktop : public GCMDriver {
base::Time GetLastTokenFetchTime() override;
void SetLastTokenFetchTime(const base::Time& time) override;
void WakeFromSuspendForHeartbeat(bool wake) override;
+ InstanceIDStore* GetInstanceIDStore() override;
+
+ // InstanceIDStore overrides:
+ void AddInstanceIDData(const std::string& app_id,
+ const std::string& instance_id_data) override;
+ void RemoveInstanceIDData(const std::string& app_id) override;
+ void GetInstanceIDData(const std::string& app_id,
+ const GetInstanceIDDataCallback& callback) override;
// Exposed for testing purpose.
bool gcm_enabled() const { return gcm_enabled_; }
@@ -130,6 +139,8 @@ class GCMDriverDesktop : public GCMDriver {
void OnDisconnected();
void GetGCMStatisticsFinished(const GCMClient::GCMStatistics& stats);
+ void GetInstanceIDDataFinished(const std::string& app_id,
+ const std::string& instance_id_data);
scoped_ptr<GCMChannelStatusSyncer> gcm_channel_status_syncer_;
@@ -172,6 +183,10 @@ class GCMDriverDesktop : public GCMDriver {
// Callback for GetGCMStatistics.
GetGCMStatisticsCallback request_gcm_statistics_callback_;
+ // Callbacks for GetInstanceIDData.
+ std::map<std::string, GetInstanceIDDataCallback>
+ get_instance_id_data_callbacks_;
+
// Used to pass a weak pointer to the IO worker.
base::WeakPtrFactory<GCMDriverDesktop> weak_ptr_factory_;
« no previous file with comments | « components/gcm_driver/gcm_driver_android.cc ('k') | components/gcm_driver/gcm_driver_desktop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698