| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 bool IsActionableError( | 62 bool IsActionableError( |
| 63 const SyncProtocolError& error) { | 63 const SyncProtocolError& error) { |
| 64 return (error.action != UNKNOWN_ACTION); | 64 return (error.action != UNKNOWN_ACTION); |
| 65 } | 65 } |
| 66 } // namespace | 66 } // namespace |
| 67 | 67 |
| 68 ConfigurationParams::ConfigurationParams() | 68 ConfigurationParams::ConfigurationParams() |
| 69 : source(GetUpdatesCallerInfo::UNKNOWN) {} | 69 : source(GetUpdatesCallerInfo::UNKNOWN) {} |
| 70 ConfigurationParams::ConfigurationParams( | 70 ConfigurationParams::ConfigurationParams( |
| 71 const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& source, | 71 const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& source, |
| 72 const ModelTypeSet& types_to_download, | 72 ModelTypeSet types_to_download, |
| 73 const ModelSafeRoutingInfo& routing_info, | 73 const ModelSafeRoutingInfo& routing_info, |
| 74 const base::Closure& ready_task) | 74 const base::Closure& ready_task) |
| 75 : source(source), | 75 : source(source), |
| 76 types_to_download(types_to_download), | 76 types_to_download(types_to_download), |
| 77 routing_info(routing_info), | 77 routing_info(routing_info), |
| 78 ready_task(ready_task) { | 78 ready_task(ready_task) { |
| 79 DCHECK(!ready_task.is_null()); | 79 DCHECK(!ready_task.is_null()); |
| 80 } | 80 } |
| 81 ConfigurationParams::~ConfigurationParams() {} | 81 ConfigurationParams::~ConfigurationParams() {} |
| 82 | 82 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 SyncEngineEvent event(SyncEngineEvent::STATUS_CHANGED); | 287 SyncEngineEvent event(SyncEngineEvent::STATUS_CHANGED); |
| 288 event.snapshot = dummy->TakeSnapshot(); | 288 event.snapshot = dummy->TakeSnapshot(); |
| 289 session_context_->NotifyListeners(event); | 289 session_context_->NotifyListeners(event); |
| 290 } | 290 } |
| 291 | 291 |
| 292 namespace { | 292 namespace { |
| 293 | 293 |
| 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 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 for (ModelTypeSet::Iterator iter = types_to_download.First(); iter.Good(); | 304 for (ModelTypeSet::Iterator iter = types_to_download.First(); iter.Good(); |
| 305 iter.Inc()) { | 305 iter.Inc()) { |
| 306 ModelType type = iter.Get(); | 306 ModelType type = iter.Get(); |
| 307 ModelSafeRoutingInfo::const_iterator route = current_routes.find(type); | 307 ModelSafeRoutingInfo::const_iterator route = current_routes.find(type); |
| (...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 | 1119 |
| 1120 #undef SDVLOG_LOC | 1120 #undef SDVLOG_LOC |
| 1121 | 1121 |
| 1122 #undef SDVLOG | 1122 #undef SDVLOG |
| 1123 | 1123 |
| 1124 #undef SLOG | 1124 #undef SLOG |
| 1125 | 1125 |
| 1126 #undef ENUM_CASE | 1126 #undef ENUM_CASE |
| 1127 | 1127 |
| 1128 } // namespace syncer | 1128 } // namespace syncer |
| OLD | NEW |