OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef SYNC_NOTIFIER_FAKE_SYNC_NOTIFIER_OBSERVER_H_ | 5 #ifndef SYNC_NOTIFIER_FAKE_SYNC_NOTIFIER_OBSERVER_H_ |
6 #define SYNC_NOTIFIER_FAKE_SYNC_NOTIFIER_OBSERVER_H_ | 6 #define SYNC_NOTIFIER_FAKE_SYNC_NOTIFIER_OBSERVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "sync/notifier/invalidation_handler.h" | 12 #include "sync/notifier/invalidation_handler.h" |
13 | 13 |
14 namespace syncer { | 14 namespace syncer { |
15 | 15 |
16 class FakeInvalidationHandler : public InvalidationHandler { | 16 class FakeInvalidationHandler : public InvalidationHandler { |
17 public: | 17 public: |
18 FakeInvalidationHandler(); | 18 FakeInvalidationHandler(); |
19 virtual ~FakeInvalidationHandler(); | 19 virtual ~FakeInvalidationHandler(); |
20 | 20 |
21 InvalidatorState GetInvalidatorState() const; | 21 InvalidatorState GetInvalidatorState() const; |
22 const ObjectIdInvalidationMap& GetLastInvalidationMap() const; | 22 const ObjectIdInvalidationMap& GetLastInvalidationMap() const; |
23 IncomingInvalidationSource GetLastInvalidationSource() const; | |
24 int GetInvalidationCount() const; | 23 int GetInvalidationCount() const; |
25 | 24 |
26 // InvalidationHandler implementation. | 25 // InvalidationHandler implementation. |
27 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE; | 26 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE; |
28 virtual void OnIncomingInvalidation( | 27 virtual void OnIncomingInvalidation( |
29 const ObjectIdInvalidationMap& invalidation_map, | 28 const ObjectIdInvalidationMap& invalidation_map) OVERRIDE; |
30 IncomingInvalidationSource source) OVERRIDE; | |
31 | 29 |
32 private: | 30 private: |
33 InvalidatorState state_; | 31 InvalidatorState state_; |
34 ObjectIdInvalidationMap last_invalidation_map_; | 32 ObjectIdInvalidationMap last_invalidation_map_; |
35 IncomingInvalidationSource last_source_; | |
36 int invalidation_count_; | 33 int invalidation_count_; |
37 | 34 |
38 DISALLOW_COPY_AND_ASSIGN(FakeInvalidationHandler); | 35 DISALLOW_COPY_AND_ASSIGN(FakeInvalidationHandler); |
39 }; | 36 }; |
40 | 37 |
41 } // namespace syncer | 38 } // namespace syncer |
42 | 39 |
43 #endif // SYNC_NOTIFIER_FAKE_SYNC_NOTIFIER_OBSERVER_H_ | 40 #endif // SYNC_NOTIFIER_FAKE_SYNC_NOTIFIER_OBSERVER_H_ |
OLD | NEW |