OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/sessions/model_type_registry.h" | 5 #include "sync/sessions/model_type_registry.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
10 #include "sync/engine/directory_commit_contributor.h" | 10 #include "sync/engine/directory_commit_contributor.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 proxy_impl, | 218 proxy_impl, |
219 base::Passed(&wrapped_worker))); | 219 base::Passed(&wrapped_worker))); |
220 | 220 |
221 DCHECK(update_handler_map_.find(type) == update_handler_map_.end()); | 221 DCHECK(update_handler_map_.find(type) == update_handler_map_.end()); |
222 DCHECK(commit_contributor_map_.find(type) == commit_contributor_map_.end()); | 222 DCHECK(commit_contributor_map_.find(type) == commit_contributor_map_.end()); |
223 | 223 |
224 update_handler_map_.insert(std::make_pair(type, worker.get())); | 224 update_handler_map_.insert(std::make_pair(type, worker.get())); |
225 commit_contributor_map_.insert(std::make_pair(type, worker.get())); | 225 commit_contributor_map_.insert(std::make_pair(type, worker.get())); |
226 | 226 |
227 // The container takes ownership. | 227 // The container takes ownership. |
228 model_type_sync_workers_.push_back(worker.release()); | 228 model_type_sync_workers_.push_back(worker.Pass()); |
229 | 229 |
230 DCHECK(Intersection(GetEnabledDirectoryTypes(), | 230 DCHECK(Intersection(GetEnabledDirectoryTypes(), |
231 GetEnabledNonBlockingTypes()).Empty()); | 231 GetEnabledNonBlockingTypes()).Empty()); |
232 } | 232 } |
233 | 233 |
234 void ModelTypeRegistry::DisconnectSyncWorker(ModelType type) { | 234 void ModelTypeRegistry::DisconnectSyncWorker(ModelType type) { |
235 DVLOG(1) << "Disabling an off-thread sync type: " << ModelTypeToString(type); | 235 DVLOG(1) << "Disabling an off-thread sync type: " << ModelTypeToString(type); |
236 DCHECK(update_handler_map_.find(type) != update_handler_map_.end()); | 236 DCHECK(update_handler_map_.find(type) != update_handler_map_.end()); |
237 DCHECK(commit_contributor_map_.find(type) != commit_contributor_map_.end()); | 237 DCHECK(commit_contributor_map_.find(type) != commit_contributor_map_.end()); |
238 | 238 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 for (ScopedVector<ModelTypeSyncWorkerImpl>::const_iterator it = | 354 for (ScopedVector<ModelTypeSyncWorkerImpl>::const_iterator it = |
355 model_type_sync_workers_.begin(); | 355 model_type_sync_workers_.begin(); |
356 it != model_type_sync_workers_.end(); | 356 it != model_type_sync_workers_.end(); |
357 ++it) { | 357 ++it) { |
358 enabled_off_thread_types.Put((*it)->GetModelType()); | 358 enabled_off_thread_types.Put((*it)->GetModelType()); |
359 } | 359 } |
360 return enabled_off_thread_types; | 360 return enabled_off_thread_types; |
361 } | 361 } |
362 | 362 |
363 } // namespace syncer | 363 } // namespace syncer |
OLD | NEW |