Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: sync/notifier/fake_invalidation_state_tracker.cc

Issue 10824140: Add InvalidationStateTracker::Forget() to erase an entry from storage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698