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

Unified Diff: sync/engine/process_updates_util.cc

Issue 93433006: sync: Introduce ModelTypeRegistry and helpers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renames and moves Created 6 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 side-by-side diff with in-line comments
Download patch
Index: sync/engine/process_updates_util.cc
diff --git a/sync/engine/process_updates_util.cc b/sync/engine/process_updates_util.cc
index 49e40b366d05b3ce52db03514a2841fafb0bbe0a..c98ec45fdd4a249483a11f71f67e129e58f3f0f7 100644
--- a/sync/engine/process_updates_util.cc
+++ b/sync/engine/process_updates_util.cc
@@ -76,34 +76,6 @@ bool UpdateContainsNewVersion(syncable::BaseTransaction *trans,
} // namespace
-void PartitionUpdatesByType(
- const sync_pb::GetUpdatesResponse& updates,
- ModelTypeSet requested_types,
- TypeSyncEntityMap* updates_by_type) {
- int update_count = updates.entries().size();
- for (ModelTypeSet::Iterator it = requested_types.First();
- it.Good(); it.Inc()) {
- updates_by_type->insert(std::make_pair(it.Get(), SyncEntityList()));
- }
- for (int i = 0; i < update_count; ++i) {
- const sync_pb::SyncEntity& update = updates.entries(i);
- ModelType type = GetModelType(update);
- if (!IsRealDataType(type)) {
- NOTREACHED() << "Received update with invalid type.";
- continue;
- }
-
- TypeSyncEntityMap::iterator it = updates_by_type->find(type);
- if (it == updates_by_type->end()) {
- DLOG(WARNING) << "Skipping update for unexpected type "
- << ModelTypeToString(type);
- continue;
- }
-
- it->second.push_back(&update);
- }
-}
-
void ProcessDownloadedUpdates(
syncable::Directory* dir,
syncable::ModelNeutralWriteTransaction* trans,

Powered by Google App Engine
This is Rietveld 408576698