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

Side by Side Diff: components/gcm_driver/instance_id/instance_id_impl.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_INSTANCE_ID_IMPL_H_ 5 #ifndef COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_IMPL_H_
6 #define COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_IMPL_H_ 6 #define COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 19 matching lines...) Expand all
30 InstanceIDImpl(const std::string& app_id, gcm::GCMDriver* gcm_driver); 30 InstanceIDImpl(const std::string& app_id, gcm::GCMDriver* gcm_driver);
31 ~InstanceIDImpl() override; 31 ~InstanceIDImpl() override;
32 32
33 // InstanceID: 33 // InstanceID:
34 void GetID(const GetIDCallback& callback) override; 34 void GetID(const GetIDCallback& callback) override;
35 void GetCreationTime(const GetCreationTimeCallback& callback) override; 35 void GetCreationTime(const GetCreationTimeCallback& callback) override;
36 void GetToken(const std::string& authorized_entity, 36 void GetToken(const std::string& authorized_entity,
37 const std::string& scope, 37 const std::string& scope,
38 const std::map<std::string, std::string>& options, 38 const std::map<std::string, std::string>& options,
39 const GetTokenCallback& callback) override; 39 const GetTokenCallback& callback) override;
40 void ValidateToken(const std::string& authorized_entity,
41 const std::string& scope,
42 const std::string& token,
43 const ValidateTokenCallback& callback) override;
40 void DeleteTokenImpl(const std::string& authorized_entity, 44 void DeleteTokenImpl(const std::string& authorized_entity,
41 const std::string& scope, 45 const std::string& scope,
42 const DeleteTokenCallback& callback) override; 46 const DeleteTokenCallback& callback) override;
43 void DeleteIDImpl(const DeleteIDCallback& callback) override; 47 void DeleteIDImpl(const DeleteIDCallback& callback) override;
44 48
45 private: 49 private:
46 void EnsureIDGenerated(); 50 void EnsureIDGenerated();
47 51
48 void OnGetTokenCompleted(const GetTokenCallback& callback, 52 void OnGetTokenCompleted(const GetTokenCallback& callback,
49 const std::string& token, 53 const std::string& token,
50 gcm::GCMClient::Result result); 54 gcm::GCMClient::Result result);
51 void OnDeleteTokenCompleted(const DeleteTokenCallback& callback, 55 void OnDeleteTokenCompleted(const DeleteTokenCallback& callback,
52 gcm::GCMClient::Result result); 56 gcm::GCMClient::Result result);
53 void OnDeleteIDCompleted(const DeleteIDCallback& callback, 57 void OnDeleteIDCompleted(const DeleteIDCallback& callback,
54 gcm::GCMClient::Result result); 58 gcm::GCMClient::Result result);
55 void GetInstanceIDDataCompleted(const std::string& instance_id, 59 void GetInstanceIDDataCompleted(const std::string& instance_id,
56 const std::string& extra_data); 60 const std::string& extra_data);
57 61
58 void DoGetID(const GetIDCallback& callback); 62 void DoGetID(const GetIDCallback& callback);
59 void DoGetCreationTime(const GetCreationTimeCallback& callback); 63 void DoGetCreationTime(const GetCreationTimeCallback& callback);
60 void DoGetToken( 64 void DoGetToken(
61 const std::string& authorized_entity, 65 const std::string& authorized_entity,
62 const std::string& scope, 66 const std::string& scope,
63 const std::map<std::string, std::string>& options, 67 const std::map<std::string, std::string>& options,
64 const GetTokenCallback& callback); 68 const GetTokenCallback& callback);
69 void DoValidateToken(const std::string& authorized_entity,
70 const std::string& scope,
71 const std::string& token,
72 const ValidateTokenCallback& callback);
65 void DoDeleteToken(const std::string& authorized_entity, 73 void DoDeleteToken(const std::string& authorized_entity,
66 const std::string& scope, 74 const std::string& scope,
67 const DeleteTokenCallback& callback); 75 const DeleteTokenCallback& callback);
68 void DoDeleteID(const DeleteIDCallback& callback); 76 void DoDeleteID(const DeleteIDCallback& callback);
69 77
70 gcm::InstanceIDHandler* Handler(); 78 gcm::InstanceIDHandler* Handler();
71 79
72 gcm::GCMDelayedTaskController delayed_task_controller_; 80 gcm::GCMDelayedTaskController delayed_task_controller_;
73 81
74 // The generated Instance ID. 82 // The generated Instance ID.
75 std::string id_; 83 std::string id_;
76 84
77 // The time when the Instance ID has been generated. 85 // The time when the Instance ID has been generated.
78 base::Time creation_time_; 86 base::Time creation_time_;
79 87
80 base::WeakPtrFactory<InstanceIDImpl> weak_ptr_factory_; 88 base::WeakPtrFactory<InstanceIDImpl> weak_ptr_factory_;
81 89
82 DISALLOW_COPY_AND_ASSIGN(InstanceIDImpl); 90 DISALLOW_COPY_AND_ASSIGN(InstanceIDImpl);
83 }; 91 };
84 92
85 } // namespace instance_id 93 } // namespace instance_id
86 94
87 #endif // COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_IMPL_H_ 95 #endif // COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_IMPL_H_
OLDNEW
« no previous file with comments | « components/gcm_driver/instance_id/instance_id_android.cc ('k') | components/gcm_driver/instance_id/instance_id_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698