OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ | 5 #ifndef GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ |
6 #define GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ | 6 #define GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 void SetGServicesSettings(const std::map<std::string, std::string>& settings, | 84 void SetGServicesSettings(const std::map<std::string, std::string>& settings, |
85 const std::string& settings_digest, | 85 const std::string& settings_digest, |
86 const UpdateCallback& callback) override; | 86 const UpdateCallback& callback) override; |
87 | 87 |
88 // Sets the account information related to device to account mapping. | 88 // Sets the account information related to device to account mapping. |
89 void AddAccountMapping(const AccountMapping& account_mapping, | 89 void AddAccountMapping(const AccountMapping& account_mapping, |
90 const UpdateCallback& callback) override; | 90 const UpdateCallback& callback) override; |
91 void RemoveAccountMapping(const std::string& account_id, | 91 void RemoveAccountMapping(const std::string& account_id, |
92 const UpdateCallback& callback) override; | 92 const UpdateCallback& callback) override; |
93 | 93 |
| 94 // Sets last token fetch time. |
| 95 void SetLastTokenFetchTime(const base::Time& time, |
| 96 const UpdateCallback& callback) override; |
| 97 |
94 private: | 98 private: |
95 typedef std::map<std::string, int> AppIdToMessageCountMap; | 99 typedef std::map<std::string, int> AppIdToMessageCountMap; |
96 | 100 |
97 // Continuation to update the per-app message counts after a load. | 101 // Continuation to update the per-app message counts after a load. |
98 void LoadContinuation(const LoadCallback& callback, | 102 void LoadContinuation(const LoadCallback& callback, |
99 scoped_ptr<LoadResult> result); | 103 scoped_ptr<LoadResult> result); |
100 | 104 |
101 // Continuation to update the per-app message counts when adding messages. | 105 // Continuation to update the per-app message counts when adding messages. |
102 // In particular, if a message fails to add, the message count is decremented. | 106 // In particular, if a message fails to add, the message count is decremented. |
103 void AddOutgoingMessageContinuation(const UpdateCallback& callback, | 107 void AddOutgoingMessageContinuation(const UpdateCallback& callback, |
(...skipping 18 matching lines...) Expand all Loading... |
122 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 126 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
123 | 127 |
124 base::WeakPtrFactory<GCMStoreImpl> weak_ptr_factory_; | 128 base::WeakPtrFactory<GCMStoreImpl> weak_ptr_factory_; |
125 | 129 |
126 DISALLOW_COPY_AND_ASSIGN(GCMStoreImpl); | 130 DISALLOW_COPY_AND_ASSIGN(GCMStoreImpl); |
127 }; | 131 }; |
128 | 132 |
129 } // namespace gcm | 133 } // namespace gcm |
130 | 134 |
131 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ | 135 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ |
OLD | NEW |