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 #include "sync/notifier/fake_invalidation_handler.h" | 5 #include "sync/notifier/fake_invalidation_handler.h" |
6 | 6 |
7 namespace syncer { | 7 namespace syncer { |
8 | 8 |
9 FakeInvalidationHandler::FakeInvalidationHandler() | 9 FakeInvalidationHandler::FakeInvalidationHandler() |
10 : state_(DEFAULT_INVALIDATION_ERROR), | 10 : state_(DEFAULT_INVALIDATION_ERROR), |
11 last_source_(LOCAL_INVALIDATION), | |
12 invalidation_count_(0) {} | 11 invalidation_count_(0) {} |
13 | 12 |
14 FakeInvalidationHandler::~FakeInvalidationHandler() {} | 13 FakeInvalidationHandler::~FakeInvalidationHandler() {} |
15 | 14 |
16 InvalidatorState FakeInvalidationHandler::GetInvalidatorState() const { | 15 InvalidatorState FakeInvalidationHandler::GetInvalidatorState() const { |
17 return state_; | 16 return state_; |
18 } | 17 } |
19 | 18 |
20 const ObjectIdInvalidationMap& | 19 const ObjectIdInvalidationMap& |
21 FakeInvalidationHandler::GetLastInvalidationMap() const { | 20 FakeInvalidationHandler::GetLastInvalidationMap() const { |
22 return last_invalidation_map_; | 21 return last_invalidation_map_; |
23 } | 22 } |
24 | 23 |
25 IncomingInvalidationSource | |
26 FakeInvalidationHandler::GetLastInvalidationSource() const { | |
27 return last_source_; | |
28 } | |
29 | |
30 int FakeInvalidationHandler::GetInvalidationCount() const { | 24 int FakeInvalidationHandler::GetInvalidationCount() const { |
31 return invalidation_count_; | 25 return invalidation_count_; |
32 } | 26 } |
33 | 27 |
34 void FakeInvalidationHandler::OnInvalidatorStateChange(InvalidatorState state) { | 28 void FakeInvalidationHandler::OnInvalidatorStateChange(InvalidatorState state) { |
35 state_ = state; | 29 state_ = state; |
36 } | 30 } |
37 | 31 |
38 void FakeInvalidationHandler::OnIncomingInvalidation( | 32 void FakeInvalidationHandler::OnIncomingInvalidation( |
39 const ObjectIdInvalidationMap& invalidation_map, | 33 const ObjectIdInvalidationMap& invalidation_map) { |
40 IncomingInvalidationSource source) { | |
41 last_invalidation_map_ = invalidation_map; | 34 last_invalidation_map_ = invalidation_map; |
42 last_source_ = source; | |
43 ++invalidation_count_; | 35 ++invalidation_count_; |
44 } | 36 } |
45 | 37 |
46 } // namespace syncer | 38 } // namespace syncer |
OLD | NEW |