| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/sync/engine_impl/uss_migrator.h" | 5 #include "components/sync/engine_impl/uss_migrator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 for (; i < batch_limit; i++) { | 96 for (; i < batch_limit; i++) { |
| 97 auto entity = base::MakeUnique<sync_pb::SyncEntity>(); | 97 auto entity = base::MakeUnique<sync_pb::SyncEntity>(); |
| 98 if (!ExtractSyncEntity(&trans, child_ids[i], entity.get())) { | 98 if (!ExtractSyncEntity(&trans, child_ids[i], entity.get())) { |
| 99 LOG(ERROR) << "Failed to fetch child node for " | 99 LOG(ERROR) << "Failed to fetch child node for " |
| 100 << ModelTypeToString(type); | 100 << ModelTypeToString(type); |
| 101 // Inform the worker so it can clear any partial data and trigger a | 101 // Inform the worker so it can clear any partial data and trigger a |
| 102 // fallback initial GetUpdates. | 102 // fallback initial GetUpdates. |
| 103 worker->AbortMigration(); | 103 worker->AbortMigration(); |
| 104 return false; | 104 return false; |
| 105 } | 105 } |
| 106 entity_ptrs.push_back(entity.get()); | 106 // Ignore tombstones; they are not included for initial GetUpdates. |
| 107 entities.push_back(std::move(entity)); | 107 if (!entity->deleted()) { |
| 108 entity_ptrs.push_back(entity.get()); |
| 109 entities.push_back(std::move(entity)); |
| 110 } |
| 108 } | 111 } |
| 109 | 112 |
| 110 worker->ProcessGetUpdatesResponse(progress, context, entity_ptrs, nullptr); | 113 worker->ProcessGetUpdatesResponse(progress, context, entity_ptrs, nullptr); |
| 111 } | 114 } |
| 112 | 115 |
| 113 worker->PassiveApplyUpdates(nullptr); | 116 worker->PassiveApplyUpdates(nullptr); |
| 114 return true; | 117 return true; |
| 115 } | 118 } |
| 116 | 119 |
| 117 } // namespace syncer | 120 } // namespace syncer |
| OLD | NEW |