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

Unified Diff: sync/syncable/directory.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/internal_api/sync_manager_impl_unittest.cc ('k') | sync/syncable/directory_backing_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/directory.cc
diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc
index f52503f84789eb5744af4a511f59c4cfbdac7060..f27d4ca7d229ad7b0e28bfb0c00e7da03984e9f0 100644
--- a/sync/syncable/directory.cc
+++ b/sync/syncable/directory.cc
@@ -81,9 +81,11 @@ void Directory::InitKernelForTest(
Directory::PersistedKernelInfo::PersistedKernelInfo()
: next_id(0) {
- for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) {
- reset_download_progress(ModelTypeFromInt(i));
- transaction_version[i] = 0;
+ ModelTypeSet protocol_types = ProtocolTypes();
+ for (ModelTypeSet::Iterator iter = protocol_types.First(); iter.Good();
+ iter.Inc()) {
+ reset_download_progress(iter.Get());
+ transaction_version[iter.Get()] = 0;
}
}
@@ -563,6 +565,8 @@ bool Directory::VacuumAfterSaveChanges(const SaveChangesSnapshot& snapshot) {
bool Directory::PurgeEntriesWithTypeIn(ModelTypeSet types,
ModelTypeSet types_to_journal) {
+ types.RemoveAll(ProxyTypes());
+
if (types.Empty())
return true;
@@ -702,9 +706,9 @@ void Directory::IncrementTransactionVersion(ModelType type) {
ModelTypeSet Directory::InitialSyncEndedTypes() {
syncable::ReadTransaction trans(FROM_HERE, this);
- const ModelTypeSet all_types = ModelTypeSet::All();
+ ModelTypeSet protocol_types = ProtocolTypes();
ModelTypeSet initial_sync_ended_types;
- for (ModelTypeSet::Iterator i = all_types.First(); i.Good(); i.Inc()) {
+ for (ModelTypeSet::Iterator i = protocol_types.First(); i.Good(); i.Inc()) {
if (InitialSyncEndedForType(&trans, i.Get())) {
initial_sync_ended_types.Put(i.Get());
}
« no previous file with comments | « sync/internal_api/sync_manager_impl_unittest.cc ('k') | sync/syncable/directory_backing_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698