| 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 // Helper to extract the routing info and workers corresponding to types in | 294 // Helper to extract the routing info and workers corresponding to types in |
| 295 // |types| from |current_routes| and |current_workers|. | 295 // |types| from |current_routes| and |current_workers|. |
| 296 void BuildModelSafeParams( | 296 void BuildModelSafeParams( |
| 297 const ModelTypeSet& types_to_download, | 297 const ModelTypeSet& types_to_download, |
| 298 const ModelSafeRoutingInfo& current_routes, | 298 const ModelSafeRoutingInfo& current_routes, |
| 299 const std::vector<ModelSafeWorker*>& current_workers, | 299 const std::vector<ModelSafeWorker*>& current_workers, |
| 300 ModelSafeRoutingInfo* result_routes, | 300 ModelSafeRoutingInfo* result_routes, |
| 301 std::vector<ModelSafeWorker*>* result_workers) { | 301 std::vector<ModelSafeWorker*>* result_workers) { |
| 302 std::set<ModelSafeGroup> active_groups; | 302 std::set<ModelSafeGroup> active_groups; |
| 303 active_groups.insert(GROUP_PASSIVE); | 303 active_groups.insert(GROUP_PASSIVE); |
| 304 active_groups.insert(GROUP_CONTROL); |
| 304 for (ModelTypeSet::Iterator iter = types_to_download.First(); iter.Good(); | 305 for (ModelTypeSet::Iterator iter = types_to_download.First(); iter.Good(); |
| 305 iter.Inc()) { | 306 iter.Inc()) { |
| 306 ModelType type = iter.Get(); | 307 ModelType type = iter.Get(); |
| 307 ModelSafeRoutingInfo::const_iterator route = current_routes.find(type); | 308 ModelSafeRoutingInfo::const_iterator route = current_routes.find(type); |
| 308 DCHECK(route != current_routes.end()); | 309 DCHECK(route != current_routes.end()); |
| 309 ModelSafeGroup group = route->second; | 310 ModelSafeGroup group = route->second; |
| 310 (*result_routes)[type] = group; | 311 (*result_routes)[type] = group; |
| 311 active_groups.insert(group); | 312 active_groups.insert(group); |
| 312 } | 313 } |
| 313 | 314 |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 | 1120 |
| 1120 #undef SDVLOG_LOC | 1121 #undef SDVLOG_LOC |
| 1121 | 1122 |
| 1122 #undef SDVLOG | 1123 #undef SDVLOG |
| 1123 | 1124 |
| 1124 #undef SLOG | 1125 #undef SLOG |
| 1125 | 1126 |
| 1126 #undef ENUM_CASE | 1127 #undef ENUM_CASE |
| 1127 | 1128 |
| 1128 } // namespace syncer | 1129 } // namespace syncer |
| OLD | NEW |