| 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_invalidator.h" | 5 #include "sync/notifier/fake_invalidator.h" |
| 6 | 6 |
| 7 namespace syncer { | 7 namespace syncer { |
| 8 | 8 |
| 9 FakeInvalidator::FakeInvalidator() {} | 9 FakeInvalidator::FakeInvalidator() {} |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 | 29 |
| 30 const std::string& FakeInvalidator::GetCredentialsEmail() const { | 30 const std::string& FakeInvalidator::GetCredentialsEmail() const { |
| 31 return email_; | 31 return email_; |
| 32 } | 32 } |
| 33 | 33 |
| 34 const std::string& FakeInvalidator::GetCredentialsToken() const { | 34 const std::string& FakeInvalidator::GetCredentialsToken() const { |
| 35 return token_; | 35 return token_; |
| 36 } | 36 } |
| 37 | 37 |
| 38 const ObjectIdStateMap& FakeInvalidator::GetLastSentIdStateMap() const { | 38 const ObjectIdInvalidationMap& |
| 39 return last_sent_id_state_map_; | 39 FakeInvalidator::GetLastSentInvalidationMap() const { |
| 40 return last_sent_invalidation_map_; |
| 40 } | 41 } |
| 41 | 42 |
| 42 void FakeInvalidator::EmitOnInvalidatorStateChange(InvalidatorState state) { | 43 void FakeInvalidator::EmitOnInvalidatorStateChange(InvalidatorState state) { |
| 43 registrar_.UpdateInvalidatorState(state); | 44 registrar_.UpdateInvalidatorState(state); |
| 44 } | 45 } |
| 45 | 46 |
| 46 void FakeInvalidator::EmitOnIncomingInvalidation( | 47 void FakeInvalidator::EmitOnIncomingInvalidation( |
| 47 const ObjectIdStateMap& id_state_map, | 48 const ObjectIdInvalidationMap& invalidation_map, |
| 48 IncomingInvalidationSource source) { | 49 IncomingInvalidationSource source) { |
| 49 registrar_.DispatchInvalidationsToHandlers(id_state_map, source); | 50 registrar_.DispatchInvalidationsToHandlers(invalidation_map, source); |
| 50 } | 51 } |
| 51 | 52 |
| 52 void FakeInvalidator::RegisterHandler(InvalidationHandler* handler) { | 53 void FakeInvalidator::RegisterHandler(InvalidationHandler* handler) { |
| 53 registrar_.RegisterHandler(handler); | 54 registrar_.RegisterHandler(handler); |
| 54 } | 55 } |
| 55 | 56 |
| 56 void FakeInvalidator::UpdateRegisteredIds(InvalidationHandler* handler, | 57 void FakeInvalidator::UpdateRegisteredIds(InvalidationHandler* handler, |
| 57 const ObjectIdSet& ids) { | 58 const ObjectIdSet& ids) { |
| 58 registrar_.UpdateRegisteredIds(handler, ids); | 59 registrar_.UpdateRegisteredIds(handler, ids); |
| 59 } | 60 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 73 void FakeInvalidator::SetStateDeprecated(const std::string& state) { | 74 void FakeInvalidator::SetStateDeprecated(const std::string& state) { |
| 74 state_ = state; | 75 state_ = state; |
| 75 } | 76 } |
| 76 | 77 |
| 77 void FakeInvalidator::UpdateCredentials( | 78 void FakeInvalidator::UpdateCredentials( |
| 78 const std::string& email, const std::string& token) { | 79 const std::string& email, const std::string& token) { |
| 79 email_ = email; | 80 email_ = email; |
| 80 token_ = token; | 81 token_ = token; |
| 81 } | 82 } |
| 82 | 83 |
| 83 void FakeInvalidator::SendInvalidation(const ObjectIdStateMap& id_state_map) { | 84 void FakeInvalidator::SendInvalidation( |
| 84 last_sent_id_state_map_ = id_state_map; | 85 const ObjectIdInvalidationMap& invalidation_map) { |
| 86 last_sent_invalidation_map_ = invalidation_map; |
| 85 } | 87 } |
| 86 | 88 |
| 87 } // namespace syncer | 89 } // namespace syncer |
| OLD | NEW |