| 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_state_tracker.h" | 5 #include "sync/notifier/fake_invalidation_state_tracker.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace syncer { | 9 namespace syncer { |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 versions_[id] = max_version; | 29 versions_[id] = max_version; |
| 30 } | 30 } |
| 31 | 31 |
| 32 int64 FakeInvalidationStateTracker::GetMaxVersion( | 32 int64 FakeInvalidationStateTracker::GetMaxVersion( |
| 33 const invalidation::ObjectId& id) const { | 33 const invalidation::ObjectId& id) const { |
| 34 InvalidationVersionMap::const_iterator it = versions_.find(id); | 34 InvalidationVersionMap::const_iterator it = versions_.find(id); |
| 35 return (it == versions_.end()) ? kMinVersion : it->second; | 35 return (it == versions_.end()) ? kMinVersion : it->second; |
| 36 } | 36 } |
| 37 | 37 |
| 38 void FakeInvalidationStateTracker::Forget(const invalidation::ObjectId& id) { |
| 39 versions_.erase(id); |
| 40 } |
| 41 |
| 38 void FakeInvalidationStateTracker::SetInvalidationState( | 42 void FakeInvalidationStateTracker::SetInvalidationState( |
| 39 const std::string& state) { | 43 const std::string& state) { |
| 40 state_ = state; | 44 state_ = state; |
| 41 } | 45 } |
| 42 | 46 |
| 43 std::string FakeInvalidationStateTracker::GetInvalidationState() const { | 47 std::string FakeInvalidationStateTracker::GetInvalidationState() const { |
| 44 return state_; | 48 return state_; |
| 45 } | 49 } |
| 46 | 50 |
| 47 } // namespace syncer | 51 } // namespace syncer |
| OLD | NEW |