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" |
11 #include "base/time/time.h" | |
jianli
2014/04/02 22:00:18
nit: not needed
fgorski
2014/04/02 22:37:21
Done.
| |
11 #include "google_apis/gcm/base/gcm_export.h" | 12 #include "google_apis/gcm/base/gcm_export.h" |
12 #include "google_apis/gcm/engine/gcm_store.h" | 13 #include "google_apis/gcm/engine/gcm_store.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 class FilePath; | 16 class FilePath; |
16 class SequencedTaskRunner; | 17 class SequencedTaskRunner; |
17 } // namespace base | 18 } // namespace base |
18 | 19 |
19 namespace gcm { | 20 namespace gcm { |
20 | 21 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 const UpdateCallback& callback) OVERRIDE; | 68 const UpdateCallback& callback) OVERRIDE; |
68 virtual void OverwriteOutgoingMessage(const std::string& persistent_id, | 69 virtual void OverwriteOutgoingMessage(const std::string& persistent_id, |
69 const MCSMessage& message, | 70 const MCSMessage& message, |
70 const UpdateCallback& callback) | 71 const UpdateCallback& callback) |
71 OVERRIDE; | 72 OVERRIDE; |
72 virtual void RemoveOutgoingMessage(const std::string& persistent_id, | 73 virtual void RemoveOutgoingMessage(const std::string& persistent_id, |
73 const UpdateCallback& callback) OVERRIDE; | 74 const UpdateCallback& callback) OVERRIDE; |
74 virtual void RemoveOutgoingMessages(const PersistentIdList& persistent_ids, | 75 virtual void RemoveOutgoingMessages(const PersistentIdList& persistent_ids, |
75 const UpdateCallback& callback) OVERRIDE; | 76 const UpdateCallback& callback) OVERRIDE; |
76 | 77 |
78 // Sets last device's checkin time. | |
79 virtual void SetLastCheckinTime(const base::Time& last_checkin_time, | |
80 const UpdateCallback& callback) OVERRIDE; | |
81 | |
77 private: | 82 private: |
78 typedef std::map<std::string, int> AppIdToMessageCountMap; | 83 typedef std::map<std::string, int> AppIdToMessageCountMap; |
79 | 84 |
80 // Continuation to update the per-app message counts after a load. | 85 // Continuation to update the per-app message counts after a load. |
81 void LoadContinuation(const LoadCallback& callback, | 86 void LoadContinuation(const LoadCallback& callback, |
82 scoped_ptr<LoadResult> result); | 87 scoped_ptr<LoadResult> result); |
83 | 88 |
84 // Continuation to update the per-app message counts when adding messages. | 89 // Continuation to update the per-app message counts when adding messages. |
85 // In particular, if a message fails to add, the message count is decremented. | 90 // In particular, if a message fails to add, the message count is decremented. |
86 void AddOutgoingMessageContinuation(const UpdateCallback& callback, | 91 void AddOutgoingMessageContinuation(const UpdateCallback& callback, |
(...skipping 18 matching lines...) Expand all Loading... | |
105 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 110 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
106 | 111 |
107 base::WeakPtrFactory<GCMStoreImpl> weak_ptr_factory_; | 112 base::WeakPtrFactory<GCMStoreImpl> weak_ptr_factory_; |
108 | 113 |
109 DISALLOW_COPY_AND_ASSIGN(GCMStoreImpl); | 114 DISALLOW_COPY_AND_ASSIGN(GCMStoreImpl); |
110 }; | 115 }; |
111 | 116 |
112 } // namespace gcm | 117 } // namespace gcm |
113 | 118 |
114 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ | 119 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ |
OLD | NEW |