| 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 // Wraps PrefService in an InvalidationStateTracker to allow SyncNotifiers | 5 // Wraps PrefService in an InvalidationStateTracker to allow SyncNotifiers |
| 6 // to use PrefService as persistence for invalidation state. It is not thread | 6 // to use PrefService as persistence for invalidation state. It is not thread |
| 7 // safe, and lives on the UI thread. | 7 // safe, and lives on the UI thread. |
| 8 | 8 |
| 9 #ifndef CHROME_BROWSER_SYNC_INVALIDATIONS_INVALIDATOR_STORAGE_H_ | 9 #ifndef CHROME_BROWSER_SYNC_INVALIDATIONS_INVALIDATOR_STORAGE_H_ |
| 10 #define CHROME_BROWSER_SYNC_INVALIDATIONS_INVALIDATOR_STORAGE_H_ | 10 #define CHROME_BROWSER_SYNC_INVALIDATIONS_INVALIDATOR_STORAGE_H_ |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 virtual ~InvalidatorStorage(); | 38 virtual ~InvalidatorStorage(); |
| 39 | 39 |
| 40 // Erases invalidation versions and state stored on disk. | 40 // Erases invalidation versions and state stored on disk. |
| 41 void Clear(); | 41 void Clear(); |
| 42 | 42 |
| 43 // InvalidationStateTracker implementation. | 43 // InvalidationStateTracker implementation. |
| 44 virtual syncer::InvalidationVersionMap GetAllMaxVersions() const | 44 virtual syncer::InvalidationVersionMap GetAllMaxVersions() const |
| 45 OVERRIDE; | 45 OVERRIDE; |
| 46 virtual void SetMaxVersion(const invalidation::ObjectId& id, | 46 virtual void SetMaxVersion(const invalidation::ObjectId& id, |
| 47 int64 max_version) OVERRIDE; | 47 int64 max_version) OVERRIDE; |
| 48 virtual void Forget(const syncer::ObjectIdSet& ids) OVERRIDE; |
| 48 // TODO(tim): These are not yet used. Bug 124140. | 49 // TODO(tim): These are not yet used. Bug 124140. |
| 49 virtual void SetInvalidationState(const std::string& state) OVERRIDE; | 50 virtual void SetInvalidationState(const std::string& state) OVERRIDE; |
| 50 virtual std::string GetInvalidationState() const OVERRIDE; | 51 virtual std::string GetInvalidationState() const OVERRIDE; |
| 51 | 52 |
| 52 private: | 53 private: |
| 53 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, SerializeEmptyMap); | 54 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, SerializeEmptyMap); |
| 54 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, | 55 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, |
| 55 DeserializeFromListOutOfRange); | 56 DeserializeFromListOutOfRange); |
| 56 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, | 57 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, |
| 57 DeserializeFromListInvalidFormat); | 58 DeserializeFromListInvalidFormat); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 85 | 86 |
| 86 // May be NULL. | 87 // May be NULL. |
| 87 PrefService* const pref_service_; | 88 PrefService* const pref_service_; |
| 88 | 89 |
| 89 DISALLOW_COPY_AND_ASSIGN(InvalidatorStorage); | 90 DISALLOW_COPY_AND_ASSIGN(InvalidatorStorage); |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 } // namespace browser_sync | 93 } // namespace browser_sync |
| 93 | 94 |
| 94 #endif // CHROME_BROWSER_SYNC_INVALIDATIONS_INVALIDATOR_STORAGE_H_ | 95 #endif // CHROME_BROWSER_SYNC_INVALIDATIONS_INVALIDATOR_STORAGE_H_ |
| OLD | NEW |