OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ |
6 #define CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ | 6 #define CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 const syncer::AckHandle& ack_handle) OVERRIDE; | 34 const syncer::AckHandle& ack_handle) OVERRIDE; |
35 | 35 |
36 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; | 36 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; |
37 virtual std::string GetInvalidatorClientId() const OVERRIDE; | 37 virtual std::string GetInvalidatorClientId() const OVERRIDE; |
38 | 38 |
39 void SetInvalidatorState(syncer::InvalidatorState state); | 39 void SetInvalidatorState(syncer::InvalidatorState state); |
40 | 40 |
41 const syncer::InvalidatorRegistrar& invalidator_registrar() const { | 41 const syncer::InvalidatorRegistrar& invalidator_registrar() const { |
42 return invalidator_registrar_; | 42 return invalidator_registrar_; |
43 } | 43 } |
44 syncer::AckHandle EmitInvalidationForTest( | 44 void EmitInvalidationForTest(const syncer::Invalidation& invalidation); |
45 const invalidation::ObjectId& object_id, | |
46 int64 version, | |
47 const std::string& payload); | |
48 | 45 |
49 // Determines if the given AckHandle has been acknowledged. | 46 // Determines if the given AckHandle has been acknowledged. |
50 bool IsInvalidationAcknowledged(const syncer::AckHandle& ack_handle) const; | 47 bool IsInvalidationAcknowledged(const syncer::AckHandle& ack_handle) const; |
51 | 48 |
52 // Determines if AcknowledgeInvalidation was ever called with an invalid | 49 // Determines if AcknowledgeInvalidation was ever called with an invalid |
53 // ObjectId/AckHandle pair. | 50 // ObjectId/AckHandle pair. |
54 bool ReceivedInvalidAcknowledgement() { | 51 bool ReceivedInvalidAcknowledgement() { |
55 return received_invalid_acknowledgement_; | 52 return received_invalid_acknowledgement_; |
56 } | 53 } |
57 | 54 |
58 private: | 55 private: |
59 std::string client_id_; | 56 std::string client_id_; |
60 syncer::InvalidatorRegistrar invalidator_registrar_; | 57 syncer::InvalidatorRegistrar invalidator_registrar_; |
61 typedef std::list<std::pair<syncer::AckHandle, invalidation::ObjectId> > | 58 typedef std::list<std::pair<syncer::AckHandle, invalidation::ObjectId> > |
62 AckHandleList; | 59 AckHandleList; |
63 AckHandleList unacknowledged_handles_; | 60 AckHandleList unacknowledged_handles_; |
64 AckHandleList acknowledged_handles_; | 61 AckHandleList acknowledged_handles_; |
65 bool received_invalid_acknowledgement_; | 62 bool received_invalid_acknowledgement_; |
66 | 63 |
67 DISALLOW_COPY_AND_ASSIGN(FakeInvalidationService); | 64 DISALLOW_COPY_AND_ASSIGN(FakeInvalidationService); |
68 }; | 65 }; |
69 | 66 |
70 } // namespace invalidation | 67 } // namespace invalidation |
71 | 68 |
72 #endif // CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ | 69 #endif // CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ |
OLD | NEW |