| 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 COMPONENTS_INVALIDATION_MOCK_ACK_HANDLER_H_ | 5 #ifndef COMPONENTS_INVALIDATION_MOCK_ACK_HANDLER_H_ |
| 6 #define COMPONENTS_INVALIDATION_MOCK_ACK_HANDLER_H_ | 6 #define COMPONENTS_INVALIDATION_MOCK_ACK_HANDLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 // Returns true if the specified invalidation was never delivered. | 50 // Returns true if the specified invalidation was never delivered. |
| 51 bool IsUnsent(const Invalidation& invalidation) const; | 51 bool IsUnsent(const Invalidation& invalidation) const; |
| 52 | 52 |
| 53 // Retruns true if all invalidations have been acked and all drops recovered. | 53 // Retruns true if all invalidations have been acked and all drops recovered. |
| 54 bool AllInvalidationsAccountedFor() const; | 54 bool AllInvalidationsAccountedFor() const; |
| 55 | 55 |
| 56 // Implementation of AckHandler. | 56 // Implementation of AckHandler. |
| 57 virtual void Acknowledge( | 57 virtual void Acknowledge( |
| 58 const invalidation::ObjectId& id, | 58 const invalidation::ObjectId& id, |
| 59 const AckHandle& handle) OVERRIDE; | 59 const AckHandle& handle) override; |
| 60 virtual void Drop( | 60 virtual void Drop( |
| 61 const invalidation::ObjectId& id, | 61 const invalidation::ObjectId& id, |
| 62 const AckHandle& handle) OVERRIDE; | 62 const AckHandle& handle) override; |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 typedef std::vector<syncer::Invalidation> InvalidationVector; | 65 typedef std::vector<syncer::Invalidation> InvalidationVector; |
| 66 typedef std::map<invalidation::ObjectId, | 66 typedef std::map<invalidation::ObjectId, |
| 67 AckHandle, | 67 AckHandle, |
| 68 ObjectIdLessThan> IdHandleMap; | 68 ObjectIdLessThan> IdHandleMap; |
| 69 | 69 |
| 70 InvalidationVector unsent_invalidations_; | 70 InvalidationVector unsent_invalidations_; |
| 71 InvalidationVector unacked_invalidations_; | 71 InvalidationVector unacked_invalidations_; |
| 72 InvalidationVector acked_invalidations_; | 72 InvalidationVector acked_invalidations_; |
| 73 InvalidationVector dropped_invalidations_; | 73 InvalidationVector dropped_invalidations_; |
| 74 | 74 |
| 75 IdHandleMap unrecovered_drop_events_; | 75 IdHandleMap unrecovered_drop_events_; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 } // namespace syncer | 78 } // namespace syncer |
| 79 | 79 |
| 80 #endif // COMPONENTS_INVALIDATION_MOCK_ACK_HANDLER_H_ | 80 #endif // COMPONENTS_INVALIDATION_MOCK_ACK_HANDLER_H_ |
| OLD | NEW |