| 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 #include "sync/engine/sync_scheduler_impl.h" | 5 #include "sync/engine/sync_scheduler_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 // Helper to extract the routing info and workers corresponding to types in | 300 // Helper to extract the routing info and workers corresponding to types in |
| 301 // |types| from |current_routes| and |current_workers|. | 301 // |types| from |current_routes| and |current_workers|. |
| 302 void BuildModelSafeParams( | 302 void BuildModelSafeParams( |
| 303 const ModelTypeSet& types_to_download, | 303 const ModelTypeSet& types_to_download, |
| 304 const ModelSafeRoutingInfo& current_routes, | 304 const ModelSafeRoutingInfo& current_routes, |
| 305 const std::vector<ModelSafeWorker*>& current_workers, | 305 const std::vector<ModelSafeWorker*>& current_workers, |
| 306 ModelSafeRoutingInfo* result_routes, | 306 ModelSafeRoutingInfo* result_routes, |
| 307 std::vector<ModelSafeWorker*>* result_workers) { | 307 std::vector<ModelSafeWorker*>* result_workers) { |
| 308 std::set<ModelSafeGroup> active_groups; | 308 std::set<ModelSafeGroup> active_groups; |
| 309 active_groups.insert(GROUP_PASSIVE); | 309 active_groups.insert(GROUP_PASSIVE); |
| 310 active_groups.insert(GROUP_CONTROL); |
| 310 for (ModelTypeSet::Iterator iter = types_to_download.First(); iter.Good(); | 311 for (ModelTypeSet::Iterator iter = types_to_download.First(); iter.Good(); |
| 311 iter.Inc()) { | 312 iter.Inc()) { |
| 312 ModelType type = iter.Get(); | 313 ModelType type = iter.Get(); |
| 313 ModelSafeRoutingInfo::const_iterator route = current_routes.find(type); | 314 ModelSafeRoutingInfo::const_iterator route = current_routes.find(type); |
| 314 DCHECK(route != current_routes.end()); | 315 DCHECK(route != current_routes.end()); |
| 315 ModelSafeGroup group = route->second; | 316 ModelSafeGroup group = route->second; |
| 316 (*result_routes)[type] = group; | 317 (*result_routes)[type] = group; |
| 317 active_groups.insert(group); | 318 active_groups.insert(group); |
| 318 } | 319 } |
| 319 | 320 |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 | 1148 |
| 1148 #undef SDVLOG_LOC | 1149 #undef SDVLOG_LOC |
| 1149 | 1150 |
| 1150 #undef SDVLOG | 1151 #undef SDVLOG |
| 1151 | 1152 |
| 1152 #undef SLOG | 1153 #undef SLOG |
| 1153 | 1154 |
| 1154 #undef ENUM_CASE | 1155 #undef ENUM_CASE |
| 1155 | 1156 |
| 1156 } // namespace syncer | 1157 } // namespace syncer |
| OLD | NEW |