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

Side by Side Diff: chrome/browser/sync/invalidations/invalidator_storage.h

Issue 11415049: Implement features needed for local ack handling in InvalidationStateTracker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ...... Created 8 years 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
« no previous file with comments | « no previous file | chrome/browser/sync/invalidations/invalidator_storage.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // 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 25 matching lines...) Expand all
36 // methods should be called. Does not own |pref_service|. 36 // methods should be called. Does not own |pref_service|.
37 explicit InvalidatorStorage(PrefService* pref_service); 37 explicit InvalidatorStorage(PrefService* pref_service);
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::InvalidationStateMap GetAllInvalidationStates() const 44 virtual syncer::InvalidationStateMap GetAllInvalidationStates() const
45 OVERRIDE; 45 OVERRIDE;
46 virtual void SetMaxVersion(const invalidation::ObjectId& id, 46 virtual void SetMaxVersionAndPayload(const invalidation::ObjectId& id,
47 int64 max_version) OVERRIDE; 47 int64 max_version,
48 const std::string& payload) OVERRIDE;
48 virtual void Forget(const syncer::ObjectIdSet& ids) OVERRIDE; 49 virtual void Forget(const syncer::ObjectIdSet& ids) OVERRIDE;
49 // TODO(tim): These are not yet used. Bug 124140. 50 // TODO(tim): These are not yet used. Bug 124140.
50 virtual void SetBootstrapData(const std::string& data) OVERRIDE; 51 virtual void SetBootstrapData(const std::string& data) OVERRIDE;
51 virtual std::string GetBootstrapData() const OVERRIDE; 52 virtual std::string GetBootstrapData() const OVERRIDE;
53 virtual void GenerateAckHandles(
54 const syncer::ObjectIdSet& ids,
55 const scoped_refptr<base::TaskRunner>& task_runner,
56 base::Callback<void(const syncer::AckHandleMap&)> callback) OVERRIDE;
57 virtual void Acknowledge(const invalidation::ObjectId& id,
58 const syncer::AckHandle& ack_handle) OVERRIDE;
52 59
53 private: 60 private:
54 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, SerializeEmptyMap); 61 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, SerializeEmptyMap);
55 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, 62 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest,
56 DeserializeFromListOutOfRange); 63 DeserializeFromListOutOfRange);
57 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, 64 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest,
58 DeserializeFromListInvalidFormat); 65 DeserializeFromListInvalidFormat);
59 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, 66 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest,
60 DeserializeFromListWithDuplicates); 67 DeserializeFromListWithDuplicates);
61 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, 68 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest,
62 DeserializeFromEmptyList); 69 DeserializeFromEmptyList);
63 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, DeserializeFromListBasic); 70 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, DeserializeFromListBasic);
71 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest,
72 DeserializeFromListMissingOptionalValues);
64 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, DeserializeMapOutOfRange); 73 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, DeserializeMapOutOfRange);
65 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, DeserializeMapInvalidFormat); 74 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, DeserializeMapInvalidFormat);
66 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, 75 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest,
67 DeserializeMapEmptyDictionary); 76 DeserializeMapEmptyDictionary);
68 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, DeserializeMapBasic); 77 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, DeserializeMapBasic);
69 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, MigrateLegacyPreferences); 78 FRIEND_TEST_ALL_PREFIXES(InvalidatorStorageTest, MigrateLegacyPreferences);
70 79
71 base::ThreadChecker thread_checker_; 80 base::ThreadChecker thread_checker_;
72 81
73 // Helpers to convert between InvalidationStateMap <--> ListValue. 82 // Helpers to convert between InvalidationStateMap <--> ListValue.
(...skipping 12 matching lines...) Expand all
86 95
87 // May be NULL. 96 // May be NULL.
88 PrefService* const pref_service_; 97 PrefService* const pref_service_;
89 98
90 DISALLOW_COPY_AND_ASSIGN(InvalidatorStorage); 99 DISALLOW_COPY_AND_ASSIGN(InvalidatorStorage);
91 }; 100 };
92 101
93 } // namespace browser_sync 102 } // namespace browser_sync
94 103
95 #endif // CHROME_BROWSER_SYNC_INVALIDATIONS_INVALIDATOR_STORAGE_H_ 104 #endif // CHROME_BROWSER_SYNC_INVALIDATIONS_INVALIDATOR_STORAGE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/invalidations/invalidator_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698