OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 // An InvalidationStateTracker is an interface that handles persisting state | 5 // An InvalidationStateTracker is an interface that handles persisting state |
6 // needed for invalidations. Currently, it is responsible for managing the | 6 // needed for invalidations. Currently, it is responsible for managing the |
7 // following information: | 7 // following information: |
8 // - Max version seen from the invalidation server to help dedupe invalidations. | 8 // - Max version seen from the invalidation server to help dedupe invalidations. |
9 // - Bootstrap data for the invalidation client. | 9 // - Bootstrap data for the invalidation client. |
10 // - Payloads and locally generated ack handles, to support local acking. | 10 // - Payloads and locally generated ack handles, to support local acking. |
(...skipping 22 matching lines...) Expand all Loading... |
33 InvalidationState(); | 33 InvalidationState(); |
34 ~InvalidationState(); | 34 ~InvalidationState(); |
35 | 35 |
36 int64 version; | 36 int64 version; |
37 std::string payload; | 37 std::string payload; |
38 AckHandle expected; | 38 AckHandle expected; |
39 AckHandle current; | 39 AckHandle current; |
40 }; | 40 }; |
41 | 41 |
42 // TODO(dcheng): Remove this in favor of adding an Equals() method. | 42 // TODO(dcheng): Remove this in favor of adding an Equals() method. |
43 bool operator==(const InvalidationState& lhs, const InvalidationState& rhs); | 43 SYNC_EXPORT_PRIVATE bool operator==(const InvalidationState& lhs, |
| 44 const InvalidationState& rhs); |
44 | 45 |
45 typedef std::map<invalidation::ObjectId, InvalidationState, ObjectIdLessThan> | 46 typedef std::map<invalidation::ObjectId, InvalidationState, ObjectIdLessThan> |
46 InvalidationStateMap; | 47 InvalidationStateMap; |
47 typedef std::map<invalidation::ObjectId, AckHandle, ObjectIdLessThan> | 48 typedef std::map<invalidation::ObjectId, AckHandle, ObjectIdLessThan> |
48 AckHandleMap; | 49 AckHandleMap; |
49 | 50 |
50 class InvalidationStateTracker { | 51 class InvalidationStateTracker { |
51 public: | 52 public: |
52 InvalidationStateTracker() {} | 53 InvalidationStateTracker() {} |
53 | 54 |
(...skipping 29 matching lines...) Expand all Loading... |
83 virtual void Acknowledge(const invalidation::ObjectId& id, | 84 virtual void Acknowledge(const invalidation::ObjectId& id, |
84 const AckHandle& ack_handle) = 0; | 85 const AckHandle& ack_handle) = 0; |
85 | 86 |
86 protected: | 87 protected: |
87 virtual ~InvalidationStateTracker() {} | 88 virtual ~InvalidationStateTracker() {} |
88 }; | 89 }; |
89 | 90 |
90 } // namespace syncer | 91 } // namespace syncer |
91 | 92 |
92 #endif // SYNC_NOTIFIER_INVALIDATION_STATE_TRACKER_H_ | 93 #endif // SYNC_NOTIFIER_INVALIDATION_STATE_TRACKER_H_ |
OLD | NEW |