| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 bool IsActionableError( | 61 bool IsActionableError( |
| 62 const SyncProtocolError& error) { | 62 const SyncProtocolError& error) { |
| 63 return (error.action != UNKNOWN_ACTION); | 63 return (error.action != UNKNOWN_ACTION); |
| 64 } | 64 } |
| 65 } // namespace | 65 } // namespace |
| 66 | 66 |
| 67 ConfigurationParams::ConfigurationParams() | 67 ConfigurationParams::ConfigurationParams() |
| 68 : source(GetUpdatesCallerInfo::UNKNOWN), | 68 : source(GetUpdatesCallerInfo::UNKNOWN) {} |
| 69 keystore_key_status(KEYSTORE_KEY_UNNECESSARY) {} | |
| 70 ConfigurationParams::ConfigurationParams( | 69 ConfigurationParams::ConfigurationParams( |
| 71 const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& source, | 70 const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& source, |
| 72 const ModelTypeSet& types_to_download, | 71 const ModelTypeSet& types_to_download, |
| 73 const ModelSafeRoutingInfo& routing_info, | 72 const ModelSafeRoutingInfo& routing_info, |
| 74 KeystoreKeyStatus keystore_key_status, | |
| 75 const base::Closure& ready_task) | 73 const base::Closure& ready_task) |
| 76 : source(source), | 74 : source(source), |
| 77 types_to_download(types_to_download), | 75 types_to_download(types_to_download), |
| 78 routing_info(routing_info), | 76 routing_info(routing_info), |
| 79 keystore_key_status(keystore_key_status), | |
| 80 ready_task(ready_task) { | 77 ready_task(ready_task) { |
| 81 DCHECK(!ready_task.is_null()); | 78 DCHECK(!ready_task.is_null()); |
| 82 } | 79 } |
| 83 ConfigurationParams::~ConfigurationParams() {} | 80 ConfigurationParams::~ConfigurationParams() {} |
| 84 | 81 |
| 85 SyncSchedulerImpl::DelayProvider::DelayProvider() {} | 82 SyncSchedulerImpl::DelayProvider::DelayProvider() {} |
| 86 SyncSchedulerImpl::DelayProvider::~DelayProvider() {} | 83 SyncSchedulerImpl::DelayProvider::~DelayProvider() {} |
| 87 | 84 |
| 88 SyncSchedulerImpl::WaitInterval::WaitInterval() | 85 SyncSchedulerImpl::WaitInterval::WaitInterval() |
| 89 : mode(UNKNOWN), | 86 : mode(UNKNOWN), |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 // crbug.com/133030 | 343 // crbug.com/133030 |
| 347 ModelSafeRoutingInfo restricted_routes; | 344 ModelSafeRoutingInfo restricted_routes; |
| 348 std::vector<ModelSafeWorker*> restricted_workers; | 345 std::vector<ModelSafeWorker*> restricted_workers; |
| 349 BuildModelSafeParams(params.types_to_download, | 346 BuildModelSafeParams(params.types_to_download, |
| 350 params.routing_info, | 347 params.routing_info, |
| 351 session_context_->workers(), | 348 session_context_->workers(), |
| 352 &restricted_routes, | 349 &restricted_routes, |
| 353 &restricted_workers); | 350 &restricted_workers); |
| 354 session_context_->set_routing_info(params.routing_info); | 351 session_context_->set_routing_info(params.routing_info); |
| 355 | 352 |
| 356 if (params.keystore_key_status == ConfigurationParams::KEYSTORE_KEY_NEEDED) { | |
| 357 // TODO(zea): implement in such a way that we can handle failures and the | |
| 358 // subsequent retrys the scheduler might perform. See crbug.com/129665. | |
| 359 NOTIMPLEMENTED(); | |
| 360 } | |
| 361 | |
| 362 // Only reconfigure if we have types to download. | 353 // Only reconfigure if we have types to download. |
| 363 if (!params.types_to_download.Empty()) { | 354 if (!params.types_to_download.Empty()) { |
| 364 DCHECK(!restricted_routes.empty()); | 355 DCHECK(!restricted_routes.empty()); |
| 365 linked_ptr<SyncSession> session(new SyncSession( | 356 linked_ptr<SyncSession> session(new SyncSession( |
| 366 session_context_, | 357 session_context_, |
| 367 this, | 358 this, |
| 368 SyncSourceInfo(params.source, | 359 SyncSourceInfo(params.source, |
| 369 ModelSafeRoutingInfoToPayloadMap( | 360 ModelSafeRoutingInfoToPayloadMap( |
| 370 restricted_routes, | 361 restricted_routes, |
| 371 std::string())), | 362 std::string())), |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 | 1147 |
| 1157 #undef SDVLOG_LOC | 1148 #undef SDVLOG_LOC |
| 1158 | 1149 |
| 1159 #undef SDVLOG | 1150 #undef SDVLOG |
| 1160 | 1151 |
| 1161 #undef SLOG | 1152 #undef SLOG |
| 1162 | 1153 |
| 1163 #undef ENUM_CASE | 1154 #undef ENUM_CASE |
| 1164 | 1155 |
| 1165 } // namespace syncer | 1156 } // namespace syncer |
| OLD | NEW |