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

Side by Side Diff: sync/internal_api/test/fake_sync_manager.cc

Issue 10905045: [Sync] Pass ModelTypeSet by value everywhere (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to head Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « sync/internal_api/sync_manager_impl.cc ('k') | sync/notifier/invalidation_util.h » ('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 #include "sync/internal_api/public/test/fake_sync_manager.h" 5 #include "sync/internal_api/public/test/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/location.h" 10 #include "base/location.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 151 }
152 progress_marker_types_.RemoveAll(partial_types); 152 progress_marker_types_.RemoveAll(partial_types);
153 cleaned_types_.PutAll(partial_types); 153 cleaned_types_.PutAll(partial_types);
154 return true; 154 return true;
155 } 155 }
156 156
157 void FakeSyncManager::UpdateCredentials(const SyncCredentials& credentials) { 157 void FakeSyncManager::UpdateCredentials(const SyncCredentials& credentials) {
158 NOTIMPLEMENTED(); 158 NOTIMPLEMENTED();
159 } 159 }
160 160
161 void FakeSyncManager::UpdateEnabledTypes(const ModelTypeSet& types) { 161 void FakeSyncManager::UpdateEnabledTypes(ModelTypeSet types) {
162 enabled_types_ = types; 162 enabled_types_ = types;
163 } 163 }
164 164
165 void FakeSyncManager::RegisterInvalidationHandler( 165 void FakeSyncManager::RegisterInvalidationHandler(
166 InvalidationHandler* handler) { 166 InvalidationHandler* handler) {
167 registrar_.RegisterHandler(handler); 167 registrar_.RegisterHandler(handler);
168 } 168 }
169 169
170 void FakeSyncManager::UpdateRegisteredInvalidationIds( 170 void FakeSyncManager::UpdateRegisteredInvalidationIds(
171 InvalidationHandler* handler, 171 InvalidationHandler* handler,
172 const ObjectIdSet& ids) { 172 const ObjectIdSet& ids) {
173 registrar_.UpdateRegisteredIds(handler, ids); 173 registrar_.UpdateRegisteredIds(handler, ids);
174 } 174 }
175 175
176 void FakeSyncManager::UnregisterInvalidationHandler( 176 void FakeSyncManager::UnregisterInvalidationHandler(
177 InvalidationHandler* handler) { 177 InvalidationHandler* handler) {
178 registrar_.UnregisterHandler(handler); 178 registrar_.UnregisterHandler(handler);
179 } 179 }
180 180
181 void FakeSyncManager::StartSyncingNormally( 181 void FakeSyncManager::StartSyncingNormally(
182 const ModelSafeRoutingInfo& routing_info) { 182 const ModelSafeRoutingInfo& routing_info) {
183 // Do nothing. 183 // Do nothing.
184 } 184 }
185 185
186 void FakeSyncManager::ConfigureSyncer( 186 void FakeSyncManager::ConfigureSyncer(
187 ConfigureReason reason, 187 ConfigureReason reason,
188 const ModelTypeSet& types_to_config, 188 ModelTypeSet types_to_config,
189 const ModelSafeRoutingInfo& new_routing_info, 189 const ModelSafeRoutingInfo& new_routing_info,
190 const base::Closure& ready_task, 190 const base::Closure& ready_task,
191 const base::Closure& retry_task) { 191 const base::Closure& retry_task) {
192 ModelTypeSet enabled_types = GetRoutingInfoTypes(new_routing_info); 192 ModelTypeSet enabled_types = GetRoutingInfoTypes(new_routing_info);
193 ModelTypeSet disabled_types = Difference( 193 ModelTypeSet disabled_types = Difference(
194 ModelTypeSet::All(), enabled_types); 194 ModelTypeSet::All(), enabled_types);
195 ModelTypeSet success_types = types_to_config; 195 ModelTypeSet success_types = types_to_config;
196 success_types.RemoveAll(configure_fail_types_); 196 success_types.RemoveAll(configure_fail_types_);
197 197
198 DVLOG(1) << "Faking configuration. Downloading: " 198 DVLOG(1) << "Faking configuration. Downloading: "
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 registrar_.EmitOnNotificationsEnabled(); 272 registrar_.EmitOnNotificationsEnabled();
273 } 273 }
274 274
275 void FakeSyncManager::DisableNotificationsOnSyncThread( 275 void FakeSyncManager::DisableNotificationsOnSyncThread(
276 NotificationsDisabledReason reason) { 276 NotificationsDisabledReason reason) {
277 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread()); 277 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread());
278 registrar_.EmitOnNotificationsDisabled(reason); 278 registrar_.EmitOnNotificationsDisabled(reason);
279 } 279 }
280 280
281 } // namespace syncer 281 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/sync_manager_impl.cc ('k') | sync/notifier/invalidation_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698