| 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 SYNC_NOTIFIER_MOCK_ACK_HANDLER_H_ | 5 #ifndef COMPONENTS_INVALIDATION_MOCK_ACK_HANDLER_H_ |
| 6 #define SYNC_NOTIFIER_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 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "sync/base/sync_export.h" | 13 #include "components/invalidation/invalidation_export.h" |
| 14 #include "sync/internal_api/public/base/ack_handler.h" |
| 15 #include "sync/internal_api/public/base/invalidation_util.h" |
| 14 #include "sync/internal_api/public/util/weak_handle.h" | 16 #include "sync/internal_api/public/util/weak_handle.h" |
| 15 #include "sync/notifier/ack_handler.h" | |
| 16 #include "sync/notifier/invalidation_util.h" | |
| 17 | 17 |
| 18 namespace syncer { | 18 namespace syncer { |
| 19 | 19 |
| 20 class Invalidation; | 20 class Invalidation; |
| 21 | 21 |
| 22 // This AckHandler implementation colaborates with the FakeInvalidationService | 22 // This AckHandler implementation colaborates with the FakeInvalidationService |
| 23 // to enable unit tests to assert that invalidations are being acked properly. | 23 // to enable unit tests to assert that invalidations are being acked properly. |
| 24 class SYNC_EXPORT MockAckHandler | 24 class INVALIDATION_EXPORT MockAckHandler |
| 25 : public AckHandler, | 25 : public AckHandler, |
| 26 public base::SupportsWeakPtr<MockAckHandler> { | 26 public base::SupportsWeakPtr<MockAckHandler> { |
| 27 public: | 27 public: |
| 28 MockAckHandler(); | 28 MockAckHandler(); |
| 29 virtual ~MockAckHandler(); | 29 virtual ~MockAckHandler(); |
| 30 | 30 |
| 31 // Sets up some internal state to track this invalidation, and modifies it so | 31 // Sets up some internal state to track this invalidation, and modifies it so |
| 32 // that its Acknowledge() and Drop() methods will route back to us. | 32 // that its Acknowledge() and Drop() methods will route back to us. |
| 33 void RegisterInvalidation(Invalidation* invalidation); | 33 void RegisterInvalidation(Invalidation* invalidation); |
| 34 | 34 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 InvalidationVector unsent_invalidations_; | 73 InvalidationVector unsent_invalidations_; |
| 74 InvalidationVector unacked_invalidations_; | 74 InvalidationVector unacked_invalidations_; |
| 75 InvalidationVector acked_invalidations_; | 75 InvalidationVector acked_invalidations_; |
| 76 InvalidationVector dropped_invalidations_; | 76 InvalidationVector dropped_invalidations_; |
| 77 | 77 |
| 78 IdHandleMap unrecovered_drop_events_; | 78 IdHandleMap unrecovered_drop_events_; |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace syncer | 81 } // namespace syncer |
| 82 | 82 |
| 83 #endif // SYNC_NOTIFIER_MOCK_ACK_HANDLER_H_ | 83 #endif // COMPONENTS_INVALIDATION_MOCK_ACK_HANDLER_H_ |
| OLD | NEW |