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

Unified Diff: components/gcm_driver/gcm_driver.h

Issue 1137463003: Support getting and deleting token for Instance ID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch to land 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_unittest.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 caae284fe837ce640da82d07d0f0338734c00813..689d721cf09d105b425dfe389123de8a2ee20f0c 100644
--- a/components/gcm_driver/gcm_driver.h
+++ b/components/gcm_driver/gcm_driver.h
@@ -22,24 +22,41 @@ class GCMAppHandler;
class GCMConnectionObserver;
struct AccountMapping;
-// Provides the capability to set/get InstanceID data in the GCM store.
-class InstanceIDStore {
+// Provides the InstanceID support via GCMDriver.
+class InstanceIDHandler {
public:
- typedef base::Callback<void(const std::string& instance_id_data)>
+ typedef base::Callback<void(const std::string& token,
+ GCMClient::Result result)> GetTokenCallback;
+ typedef base::Callback<void(GCMClient::Result result)> DeleteTokenCallback;
+ typedef base::Callback<void(const std::string& instance_id,
+ const std::string& extra_data)>
GetInstanceIDDataCallback;
- InstanceIDStore();
- virtual ~InstanceIDStore();
-
+ InstanceIDHandler();
+ virtual ~InstanceIDHandler();
+
+ // Token service.
+ virtual void GetToken(const std::string& app_id,
+ const std::string& authorized_entity,
+ const std::string& scope,
+ const std::map<std::string, std::string>& options,
+ const GetTokenCallback& callback) = 0;
+ virtual void DeleteToken(const std::string& app_id,
+ const std::string& authorized_entity,
+ const std::string& scope,
+ const DeleteTokenCallback& callback) = 0;
+
+ // Persistence support.
virtual void AddInstanceIDData(const std::string& app_id,
- const std::string& instance_id_data) = 0;
+ const std::string& instance_id,
+ const std::string& extra_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);
+ DISALLOW_COPY_AND_ASSIGN(InstanceIDHandler);
};
// Bridge between GCM users in Chrome and the platform-specific implementation.
@@ -166,8 +183,8 @@ 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;
+ // Supports InstanceID handling.
+ virtual InstanceIDHandler* GetInstanceIDHandler() = 0;
// Adds or removes a custom client requested heartbeat interval. If multiple
// components set that setting, the lowest setting will be used. If the
« no previous file with comments | « components/gcm_driver/gcm_client_impl_unittest.cc ('k') | components/gcm_driver/gcm_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698