Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: components/sync/engine_impl/uss_migrator.cc

Issue 2630613002: [Sync] USS: Filter out tombstones for initial sync. (Closed)
Patch Set: Fix TestEntryFactory for realz. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/sync/engine_impl/test_entry_factory.cc ('k') | components/sync/engine_impl/uss_migrator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698