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

Unified Diff: sync/syncable/directory_backing_store.cc

Issue 11958029: [Sync] Add support for proxy types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch to ProxyTypes Created 7 years, 10 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
« no previous file with comments | « sync/syncable/directory.cc ('k') | sync/syncable/directory_backing_store_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/directory_backing_store.cc
diff --git a/sync/syncable/directory_backing_store.cc b/sync/syncable/directory_backing_store.cc
index a2069a98ddc2ae689bb916e5208a0d7a55b3db4f..06839574b06e4a293c63edef5b917f8b8f081411 100644
--- a/sync/syncable/directory_backing_store.cc
+++ b/sync/syncable/directory_backing_store.cc
@@ -262,14 +262,17 @@ bool DirectoryBackingStore::SaveChanges(
"INTO models (model_id, progress_marker, transaction_version) "
"VALUES (?, ?, ?)"));
- for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) {
+ ModelTypeSet protocol_types = ProtocolTypes();
+ for (ModelTypeSet::Iterator iter = protocol_types.First(); iter.Good();
+ iter.Inc()) {
+ ModelType type = iter.Get();
// We persist not ModelType but rather a protobuf-derived ID.
- string model_id = ModelTypeEnumToModelId(ModelTypeFromInt(i));
+ string model_id = ModelTypeEnumToModelId(type);
string progress_marker;
- info.download_progress[i].SerializeToString(&progress_marker);
+ info.download_progress[type].SerializeToString(&progress_marker);
s2.BindBlob(0, model_id.data(), model_id.length());
s2.BindBlob(1, progress_marker.data(), progress_marker.length());
- s2.BindInt64(2, info.transaction_version[i]);
+ s2.BindInt64(2, info.transaction_version[type]);
if (!s2.Run())
return false;
DCHECK_EQ(db_->GetLastChangeCount(), 1);
« no previous file with comments | « sync/syncable/directory.cc ('k') | sync/syncable/directory_backing_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698