| 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 SYNC_TEST_MOCK_INVALIDATION_TRACKER_H_ | 5 #ifndef SYNC_TEST_MOCK_INVALIDATION_TRACKER_H_ |
| 6 #define SYNC_TEST_MOCK_INVALIDATION_TRACKER_H_ | 6 #define SYNC_TEST_MOCK_INVALIDATION_TRACKER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <set> | 10 #include <set> |
| 9 #include <string> | 11 #include <string> |
| 10 | 12 |
| 11 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 12 #include "sync/test/trackable_mock_invalidation.h" | 14 #include "sync/test/trackable_mock_invalidation.h" |
| 13 | 15 |
| 14 namespace syncer { | 16 namespace syncer { |
| 15 | 17 |
| 16 // Instantiates and track the acknowledgement state of | 18 // Instantiates and track the acknowledgement state of |
| 17 // TrackableMockInvalidations. | 19 // TrackableMockInvalidations. |
| 18 class MockInvalidationTracker { | 20 class MockInvalidationTracker { |
| 19 public: | 21 public: |
| 20 // Builers to return new TrackableMockInvalidations associated with this | 22 // Builers to return new TrackableMockInvalidations associated with this |
| 21 // object. | 23 // object. |
| 22 scoped_ptr<TrackableMockInvalidation> IssueUnknownVersionInvalidation(); | 24 scoped_ptr<TrackableMockInvalidation> IssueUnknownVersionInvalidation(); |
| 23 scoped_ptr<TrackableMockInvalidation> IssueInvalidation( | 25 scoped_ptr<TrackableMockInvalidation> IssueInvalidation( |
| 24 int64 version, | 26 int64_t version, |
| 25 const std::string& payload); | 27 const std::string& payload); |
| 26 | 28 |
| 27 MockInvalidationTracker(); | 29 MockInvalidationTracker(); |
| 28 ~MockInvalidationTracker(); | 30 ~MockInvalidationTracker(); |
| 29 | 31 |
| 30 // Records the acknowledgement of the invalidation | 32 // Records the acknowledgement of the invalidation |
| 31 // specified by the given ID. | 33 // specified by the given ID. |
| 32 void Acknowledge(int invaliation_id); | 34 void Acknowledge(int invaliation_id); |
| 33 | 35 |
| 34 // Records the drop of the invalidation specified by the given ID. | 36 // Records the drop of the invalidation specified by the given ID. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 57 // acknowledged or dropped items to the proper set. An invalidation may be | 59 // acknowledged or dropped items to the proper set. An invalidation may be |
| 58 // both dropped and acknowledged if it represents the recovery from a drop | 60 // both dropped and acknowledged if it represents the recovery from a drop |
| 59 // event. | 61 // event. |
| 60 std::set<int> dropped_; | 62 std::set<int> dropped_; |
| 61 std::set<int> acknowledged_; | 63 std::set<int> acknowledged_; |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 } // namespace syncer | 66 } // namespace syncer |
| 65 | 67 |
| 66 #endif // SYNC_TEST_MOCK_INVALIDATION_TRACKER_H_ | 68 #endif // SYNC_TEST_MOCK_INVALIDATION_TRACKER_H_ |
| OLD | NEW |