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

Side by Side Diff: components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.h

Issue 2697793004: Push API: Validate storage before returning cached subscriptions (Closed)
Patch Set: Fix include Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_GCM_DRIVER_INSTANCE_ID_FAKE_GCM_DRIVER__FOR_INSTANCE_ID_H_ 5 #ifndef COMPONENTS_GCM_DRIVER_INSTANCE_ID_FAKE_GCM_DRIVER__FOR_INSTANCE_ID_H_
6 #define COMPONENTS_GCM_DRIVER_INSTANCE_ID_FAKE_GCM_DRIVER__FOR_INSTANCE_ID_H_ 6 #define COMPONENTS_GCM_DRIVER_INSTANCE_ID_FAKE_GCM_DRIVER__FOR_INSTANCE_ID_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 29 matching lines...) Expand all
40 return last_deletetoken_app_id_; 40 return last_deletetoken_app_id_;
41 } 41 }
42 42
43 protected: 43 protected:
44 // InstanceIDHandler overrides: 44 // InstanceIDHandler overrides:
45 void GetToken(const std::string& app_id, 45 void GetToken(const std::string& app_id,
46 const std::string& authorized_entity, 46 const std::string& authorized_entity,
47 const std::string& scope, 47 const std::string& scope,
48 const std::map<std::string, std::string>& options, 48 const std::map<std::string, std::string>& options,
49 const GetTokenCallback& callback) override; 49 const GetTokenCallback& callback) override;
50 void ValidateToken(const std::string& app_id,
51 const std::string& authorized_entity,
52 const std::string& scope,
53 const std::string& token,
54 const ValidateTokenCallback& callback) override;
50 void DeleteToken(const std::string& app_id, 55 void DeleteToken(const std::string& app_id,
51 const std::string& authorized_entity, 56 const std::string& authorized_entity,
52 const std::string& scope, 57 const std::string& scope,
53 const DeleteTokenCallback& callback) override; 58 const DeleteTokenCallback& callback) override;
54 void AddInstanceIDData(const std::string& app_id, 59 void AddInstanceIDData(const std::string& app_id,
55 const std::string& instance_id, 60 const std::string& instance_id,
56 const std::string& extra_data) override; 61 const std::string& extra_data) override;
57 void RemoveInstanceIDData(const std::string& app_id) override; 62 void RemoveInstanceIDData(const std::string& app_id) override;
58 void GetInstanceIDData( 63 void GetInstanceIDData(
59 const std::string& app_id, 64 const std::string& app_id,
60 const GetInstanceIDDataCallback& callback) override; 65 const GetInstanceIDDataCallback& callback) override;
61 66
62 private: 67 private:
63 std::map<std::string, std::pair<std::string, std::string>> instance_id_data_; 68 std::map<std::string, std::pair<std::string, std::string>> instance_id_data_;
64 std::map<std::string, std::string> tokens_; 69 std::map<std::string, std::string> tokens_;
65 std::string last_gettoken_app_id_; 70 std::string last_gettoken_app_id_;
66 std::string last_gettoken_authorized_entity_; 71 std::string last_gettoken_authorized_entity_;
67 std::string last_deletetoken_app_id_; 72 std::string last_deletetoken_app_id_;
68 73
69 DISALLOW_COPY_AND_ASSIGN(FakeGCMDriverForInstanceID); 74 DISALLOW_COPY_AND_ASSIGN(FakeGCMDriverForInstanceID);
70 }; 75 };
71 76
72 } // namespace instance_id 77 } // namespace instance_id
73 78
74 #endif // COMPONENTS_GCM_DRIVER_INSTANCE_ID_FAKE_GCM_DRIVER__FOR_INSTANCE_ID_H_ 79 #endif // COMPONENTS_GCM_DRIVER_INSTANCE_ID_FAKE_GCM_DRIVER__FOR_INSTANCE_ID_H_
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_driver_desktop.cc ('k') | components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698