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

Side by Side Diff: components/sync/engine/fake_sync_manager.h

Issue 2641523004: [Sync] Make directory types registration explicit in ModelTypeRegistry (Closed)
Patch Set: Created 3 years, 11 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
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 #ifndef COMPONENTS_SYNC_ENGINE_FAKE_SYNC_MANAGER_H_ 5 #ifndef COMPONENTS_SYNC_ENGINE_FAKE_SYNC_MANAGER_H_
6 #define COMPONENTS_SYNC_ENGINE_FAKE_SYNC_MANAGER_H_ 6 #define COMPONENTS_SYNC_ENGINE_FAKE_SYNC_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 // Returns those types that have been unapplied as part of purging disabled 49 // Returns those types that have been unapplied as part of purging disabled
50 // types since the last call to GetAndResetUnappliedTypes, or since startup if 50 // types since the last call to GetAndResetUnappliedTypes, or since startup if
51 // never called. 51 // never called.
52 ModelTypeSet GetAndResetUnappliedTypes(); 52 ModelTypeSet GetAndResetUnappliedTypes();
53 53
54 // Returns those types that have been downloaded since the last call to 54 // Returns those types that have been downloaded since the last call to
55 // GetAndResetDownloadedTypes(), or since startup if never called. 55 // GetAndResetDownloadedTypes(), or since startup if never called.
56 ModelTypeSet GetAndResetDownloadedTypes(); 56 ModelTypeSet GetAndResetDownloadedTypes();
57 57
58 // Returns those types that have been marked as enabled since the
59 // last call to GetAndResetEnabledTypes(), or since startup if never
60 // called.
61 ModelTypeSet GetAndResetEnabledTypes();
62
63 // Returns the types that have most recently received a refresh request. 58 // Returns the types that have most recently received a refresh request.
64 ModelTypeSet GetLastRefreshRequestTypes(); 59 ModelTypeSet GetLastRefreshRequestTypes();
65 60
66 // Returns the most recent configuration reason since the last call to 61 // Returns the most recent configuration reason since the last call to
67 // GetAndResetConfigureReason, or since startup if never called. 62 // GetAndResetConfigureReason, or since startup if never called.
68 ConfigureReason GetAndResetConfigureReason(); 63 ConfigureReason GetAndResetConfigureReason();
69 64
70 // Returns the number of invalidations received since startup. 65 // Returns the number of invalidations received since startup.
71 int GetInvalidationCount() const; 66 int GetInvalidationCount() const;
72 67
73 // Block until the sync thread has finished processing any pending messages. 68 // Block until the sync thread has finished processing any pending messages.
74 void WaitForSyncThread(); 69 void WaitForSyncThread();
75 70
76 // SyncManager implementation. 71 // SyncManager implementation.
77 // Note: we treat whatever message loop this is called from as the sync 72 // Note: we treat whatever message loop this is called from as the sync
78 // loop for purposes of callbacks. 73 // loop for purposes of callbacks.
79 void Init(InitArgs* args) override; 74 void Init(InitArgs* args) override;
80 ModelTypeSet InitialSyncEndedTypes() override; 75 ModelTypeSet InitialSyncEndedTypes() override;
81 ModelTypeSet GetTypesWithEmptyProgressMarkerToken( 76 ModelTypeSet GetTypesWithEmptyProgressMarkerToken(
82 ModelTypeSet types) override; 77 ModelTypeSet types) override;
83 void PurgePartiallySyncedTypes() override; 78 void PurgePartiallySyncedTypes() override;
84 void PurgeDisabledTypes(ModelTypeSet to_purge, 79 void PurgeDisabledTypes(ModelTypeSet to_purge,
85 ModelTypeSet to_journal, 80 ModelTypeSet to_journal,
86 ModelTypeSet to_unapply) override; 81 ModelTypeSet to_unapply) override;
87 void UpdateCredentials(const SyncCredentials& credentials) override; 82 void UpdateCredentials(const SyncCredentials& credentials) override;
88 void StartSyncingNormally(const ModelSafeRoutingInfo& routing_info, 83 void StartSyncingNormally(base::Time last_poll_time) override;
89 base::Time last_poll_time) override; 84 void StartConfiguration() override;
90 void ConfigureSyncer(ConfigureReason reason, 85 void ConfigureSyncer(ConfigureReason reason,
91 ModelTypeSet to_download, 86 ModelTypeSet to_download,
92 const ModelSafeRoutingInfo& new_routing_info,
93 const base::Closure& ready_task, 87 const base::Closure& ready_task,
94 const base::Closure& retry_task) override; 88 const base::Closure& retry_task) override;
95 void OnIncomingInvalidation( 89 void OnIncomingInvalidation(
96 ModelType type, 90 ModelType type,
97 std::unique_ptr<InvalidationInterface> interface) override; 91 std::unique_ptr<InvalidationInterface> interface) override;
98 void SetInvalidatorEnabled(bool invalidator_enabled) override; 92 void SetInvalidatorEnabled(bool invalidator_enabled) override;
99 void AddObserver(Observer* observer) override; 93 void AddObserver(Observer* observer) override;
100 void RemoveObserver(Observer* observer) override; 94 void RemoveObserver(Observer* observer) override;
101 SyncStatus GetDetailedStatus() const override; 95 SyncStatus GetDetailedStatus() const override;
102 void SaveChanges() override; 96 void SaveChanges() override;
(...skipping 30 matching lines...) Expand all
133 // Test specific state. 127 // Test specific state.
134 // The types that should fail configuration attempts. These types will not 128 // The types that should fail configuration attempts. These types will not
135 // have their progress markers or initial_sync_ended bits set. 129 // have their progress markers or initial_sync_ended bits set.
136 ModelTypeSet configure_fail_types_; 130 ModelTypeSet configure_fail_types_;
137 // The set of types that have been purged. 131 // The set of types that have been purged.
138 ModelTypeSet purged_types_; 132 ModelTypeSet purged_types_;
139 // Subset of |purged_types_| that were unapplied. 133 // Subset of |purged_types_| that were unapplied.
140 ModelTypeSet unapplied_types_; 134 ModelTypeSet unapplied_types_;
141 // The set of types that have been downloaded. 135 // The set of types that have been downloaded.
142 ModelTypeSet downloaded_types_; 136 ModelTypeSet downloaded_types_;
143 // The set of types that have been enabled.
144 ModelTypeSet enabled_types_;
145 137
146 // The types for which a refresh was most recently requested. 138 // The types for which a refresh was most recently requested.
147 ModelTypeSet last_refresh_request_types_; 139 ModelTypeSet last_refresh_request_types_;
148 140
149 // The most recent configure reason. 141 // The most recent configure reason.
150 ConfigureReason last_configure_reason_; 142 ConfigureReason last_configure_reason_;
151 143
152 std::unique_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_; 144 std::unique_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_;
153 145
154 TestUserShare test_user_share_; 146 TestUserShare test_user_share_;
155 147
156 // Number of invalidations received since startup. 148 // Number of invalidations received since startup.
157 int num_invalidations_received_; 149 int num_invalidations_received_;
158 150
159 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); 151 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager);
160 }; 152 };
161 153
162 } // namespace syncer 154 } // namespace syncer
163 155
164 #endif // COMPONENTS_SYNC_ENGINE_FAKE_SYNC_MANAGER_H_ 156 #endif // COMPONENTS_SYNC_ENGINE_FAKE_SYNC_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698