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

Unified Diff: components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.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
Index: components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.h
diff --git a/components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.h b/components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.h
index d5f9dd112faccfcdc28614cdb9a95a6892dff71e..9d6b77ac9c568619a783ba7f01e25587f5f1bb32 100644
--- a/components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.h
+++ b/components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.h
@@ -7,6 +7,7 @@
#include <map>
#include <string>
+#include <utility>
#include "base/compiler_specific.h"
#include "base/macros.h"
@@ -15,24 +16,35 @@
namespace instance_id {
class FakeGCMDriverForInstanceID : public gcm::FakeGCMDriver,
- public gcm::InstanceIDStore {
+ public gcm::InstanceIDHandler {
public:
FakeGCMDriverForInstanceID();
~FakeGCMDriverForInstanceID() override;
// FakeGCMDriver overrides:
- gcm::InstanceIDStore* GetInstanceIDStore() override;
-
- // InstanceIDStore overrides:
+ gcm::InstanceIDHandler* GetInstanceIDHandler() override;
+
+ // InstanceIDHandler overrides:
+ 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) override;
+ void DeleteToken(const std::string& app_id,
+ const std::string& authorized_entity,
+ const std::string& scope,
+ const DeleteTokenCallback& callback) override;
void AddInstanceIDData(const std::string& app_id,
- const std::string& instance_id_data) override;
+ const std::string& instance_id,
+ const std::string& extra_data) override;
void RemoveInstanceIDData(const std::string& app_id) override;
void GetInstanceIDData(
const std::string& app_id,
- const gcm::InstanceIDStore::GetInstanceIDDataCallback& callback) override;
+ const GetInstanceIDDataCallback& callback) override;
private:
- std::map<std::string, std::string> instance_id_data_;
+ std::map<std::string, std::pair<std::string, std::string>> instance_id_data_;
+ std::map<std::string, std::string> tokens_;
DISALLOW_COPY_AND_ASSIGN(FakeGCMDriverForInstanceID);
};

Powered by Google App Engine
This is Rietveld 408576698