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 #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 // Returns those types that have been marked as enabled since the | 52 // Returns those types that have been marked as enabled since the |
53 // last call to GetAndResetEnabledTypes(), or since startup if never | 53 // last call to GetAndResetEnabledTypes(), or since startup if never |
54 // called. | 54 // called. |
55 ModelTypeSet GetAndResetEnabledTypes(); | 55 ModelTypeSet GetAndResetEnabledTypes(); |
56 | 56 |
57 // Returns the types that have most recently received a refresh request. | 57 // Returns the types that have most recently received a refresh request. |
58 ModelTypeSet GetLastRefreshRequestTypes(); | 58 ModelTypeSet GetLastRefreshRequestTypes(); |
59 | 59 |
60 // Posts a method to invalidate the given IDs on the sync thread. | 60 // Posts a method to invalidate the given IDs on the sync thread. |
61 void Invalidate(const ObjectIdInvalidationMap& invalidation_map, | 61 void Invalidate(const ObjectIdInvalidationMap& invalidation_map); |
62 IncomingInvalidationSource source); | |
63 | 62 |
64 // Posts a method to update the invalidator state on the sync thread. | 63 // Posts a method to update the invalidator state on the sync thread. |
65 void UpdateInvalidatorState(InvalidatorState state); | 64 void UpdateInvalidatorState(InvalidatorState state); |
66 | 65 |
67 // Block until the sync thread has finished processing any pending messages. | 66 // Block until the sync thread has finished processing any pending messages. |
68 void WaitForSyncThread(); | 67 void WaitForSyncThread(); |
69 | 68 |
70 // SyncManager implementation. | 69 // SyncManager implementation. |
71 // Note: we treat whatever message loop this is called from as the sync | 70 // Note: we treat whatever message loop this is called from as the sync |
72 // loop for purposes of callbacks. | 71 // loop for purposes of callbacks. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 virtual void ShutdownOnSyncThread() OVERRIDE; | 119 virtual void ShutdownOnSyncThread() OVERRIDE; |
121 virtual UserShare* GetUserShare() OVERRIDE; | 120 virtual UserShare* GetUserShare() OVERRIDE; |
122 virtual const std::string cache_guid() OVERRIDE; | 121 virtual const std::string cache_guid() OVERRIDE; |
123 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; | 122 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; |
124 virtual bool HasUnsyncedItems() OVERRIDE; | 123 virtual bool HasUnsyncedItems() OVERRIDE; |
125 virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE; | 124 virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE; |
126 virtual void RefreshTypes(ModelTypeSet types) OVERRIDE; | 125 virtual void RefreshTypes(ModelTypeSet types) OVERRIDE; |
127 | 126 |
128 private: | 127 private: |
129 void InvalidateOnSyncThread( | 128 void InvalidateOnSyncThread( |
130 const ObjectIdInvalidationMap& invalidation_map, | 129 const ObjectIdInvalidationMap& invalidation_map); |
131 IncomingInvalidationSource source); | |
132 void UpdateInvalidatorStateOnSyncThread(InvalidatorState state); | 130 void UpdateInvalidatorStateOnSyncThread(InvalidatorState state); |
133 | 131 |
134 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; | 132 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; |
135 | 133 |
136 ObserverList<SyncManager::Observer> observers_; | 134 ObserverList<SyncManager::Observer> observers_; |
137 | 135 |
138 // Faked directory state. | 136 // Faked directory state. |
139 ModelTypeSet initial_sync_ended_types_; | 137 ModelTypeSet initial_sync_ended_types_; |
140 ModelTypeSet progress_marker_types_; | 138 ModelTypeSet progress_marker_types_; |
141 | 139 |
(...skipping 17 matching lines...) Expand all Loading... |
159 scoped_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_; | 157 scoped_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_; |
160 | 158 |
161 TestUserShare test_user_share_; | 159 TestUserShare test_user_share_; |
162 | 160 |
163 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); | 161 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); |
164 }; | 162 }; |
165 | 163 |
166 } // namespace syncer | 164 } // namespace syncer |
167 | 165 |
168 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ | 166 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ |
OLD | NEW |