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

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

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 #include "components/sync/engine/fake_sync_manager.h" 5 #include "components/sync/engine/fake_sync_manager.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 unapplied_types_.Clear(); 50 unapplied_types_.Clear();
51 return unapplied_types; 51 return unapplied_types;
52 } 52 }
53 53
54 ModelTypeSet FakeSyncManager::GetAndResetDownloadedTypes() { 54 ModelTypeSet FakeSyncManager::GetAndResetDownloadedTypes() {
55 ModelTypeSet downloaded_types = downloaded_types_; 55 ModelTypeSet downloaded_types = downloaded_types_;
56 downloaded_types_.Clear(); 56 downloaded_types_.Clear();
57 return downloaded_types; 57 return downloaded_types;
58 } 58 }
59 59
60 ModelTypeSet FakeSyncManager::GetAndResetEnabledTypes() {
61 ModelTypeSet enabled_types = enabled_types_;
62 enabled_types_.Clear();
63 return enabled_types;
64 }
65
66 ConfigureReason FakeSyncManager::GetAndResetConfigureReason() { 60 ConfigureReason FakeSyncManager::GetAndResetConfigureReason() {
67 ConfigureReason reason = last_configure_reason_; 61 ConfigureReason reason = last_configure_reason_;
68 last_configure_reason_ = CONFIGURE_REASON_UNKNOWN; 62 last_configure_reason_ = CONFIGURE_REASON_UNKNOWN;
69 return reason; 63 return reason;
70 } 64 }
71 65
72 int FakeSyncManager::GetInvalidationCount() const { 66 int FakeSyncManager::GetInvalidationCount() const {
73 return num_invalidations_received_; 67 return num_invalidations_received_;
74 } 68 }
75 69
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // Types from |to_unapply| should retain their server data and progress 131 // Types from |to_unapply| should retain their server data and progress
138 // markers. 132 // markers.
139 initial_sync_ended_types_.RemoveAll(Difference(to_purge, to_unapply)); 133 initial_sync_ended_types_.RemoveAll(Difference(to_purge, to_unapply));
140 progress_marker_types_.RemoveAll(Difference(to_purge, to_unapply)); 134 progress_marker_types_.RemoveAll(Difference(to_purge, to_unapply));
141 } 135 }
142 136
143 void FakeSyncManager::UpdateCredentials(const SyncCredentials& credentials) { 137 void FakeSyncManager::UpdateCredentials(const SyncCredentials& credentials) {
144 NOTIMPLEMENTED(); 138 NOTIMPLEMENTED();
145 } 139 }
146 140
147 void FakeSyncManager::StartSyncingNormally( 141 void FakeSyncManager::StartSyncingNormally(base::Time last_poll_time) {
148 const ModelSafeRoutingInfo& routing_info, 142 // Do nothing.
149 base::Time last_poll_time) { 143 }
144
145 void FakeSyncManager::StartConfiguration() {
150 // Do nothing. 146 // Do nothing.
151 } 147 }
152 148
153 void FakeSyncManager::ConfigureSyncer( 149 void FakeSyncManager::ConfigureSyncer(
154 ConfigureReason reason, 150 ConfigureReason reason,
155 ModelTypeSet to_download, 151 ModelTypeSet to_download,
156 const ModelSafeRoutingInfo& new_routing_info,
157 const base::Closure& ready_task, 152 const base::Closure& ready_task,
158 const base::Closure& retry_task) { 153 const base::Closure& retry_task) {
159 last_configure_reason_ = reason; 154 last_configure_reason_ = reason;
160 enabled_types_ = GetRoutingInfoTypes(new_routing_info);
161 ModelTypeSet success_types = to_download; 155 ModelTypeSet success_types = to_download;
162 success_types.RemoveAll(configure_fail_types_); 156 success_types.RemoveAll(configure_fail_types_);
163 157
164 DVLOG(1) << "Faking configuration. Downloading: " 158 DVLOG(1) << "Faking configuration. Downloading: "
165 << ModelTypeSetToString(success_types); 159 << ModelTypeSetToString(success_types);
166 160
167 // Update our fake directory by clearing and fake-downloading as necessary. 161 // Update our fake directory by clearing and fake-downloading as necessary.
168 UserShare* share = GetUserShare(); 162 UserShare* share = GetUserShare();
169 for (ModelTypeSet::Iterator it = success_types.First(); it.Good(); it.Inc()) { 163 for (ModelTypeSet::Iterator it = success_types.First(); it.Good(); it.Inc()) {
170 // We must be careful to not create the same root node twice. 164 // We must be careful to not create the same root node twice.
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 } 265 }
272 266
273 void FakeSyncManager::OnCookieJarChanged(bool account_mismatch, 267 void FakeSyncManager::OnCookieJarChanged(bool account_mismatch,
274 bool empty_jar) {} 268 bool empty_jar) {}
275 269
276 void FakeSyncManager::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) { 270 void FakeSyncManager::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) {
277 NOTIMPLEMENTED(); 271 NOTIMPLEMENTED();
278 } 272 }
279 273
280 } // namespace syncer 274 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698