| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sync/engine/apply_updates_command.h" | 5 #include "sync/engine/apply_updates_command.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "sync/engine/update_applicator.h" | 8 #include "sync/engine/update_applicator.h" |
| 9 #include "sync/sessions/sync_session.h" | 9 #include "sync/sessions/sync_session.h" |
| 10 #include "sync/syncable/directory.h" | 10 #include "sync/syncable/directory.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 syncable::FullModelTypeSet server_types_with_unapplied_updates; | 25 syncable::FullModelTypeSet server_types_with_unapplied_updates; |
| 26 { | 26 { |
| 27 syncable::Directory* dir = session.context()->directory(); | 27 syncable::Directory* dir = session.context()->directory(); |
| 28 syncable::ReadTransaction trans(FROM_HERE, dir); | 28 syncable::ReadTransaction trans(FROM_HERE, dir); |
| 29 server_types_with_unapplied_updates = | 29 server_types_with_unapplied_updates = |
| 30 dir->GetServerTypesWithUnappliedUpdates(&trans); | 30 dir->GetServerTypesWithUnappliedUpdates(&trans); |
| 31 } | 31 } |
| 32 | 32 |
| 33 for (syncable::FullModelTypeSet::Iterator it = | 33 for (syncable::FullModelTypeSet::Iterator it = |
| 34 server_types_with_unapplied_updates.First(); it.Good(); it.Inc()) { | 34 server_types_with_unapplied_updates.First(); it.Good(); it.Inc()) { |
| 35 VLOG(2) << "TYPES: " << ModelTypeToString(it.Get()); |
| 35 groups_with_unapplied_updates.insert( | 36 groups_with_unapplied_updates.insert( |
| 36 GetGroupForModelType(it.Get(), session.routing_info())); | 37 GetGroupForModelType(it.Get(), session.routing_info())); |
| 37 } | 38 } |
| 38 | 39 |
| 40 // The INTERNAL types are special. They have their own update routines, |
| 41 // ApplyUpdatesCommand should not process them. |
| 42 groups_with_unapplied_updates.erase(GROUP_CONTROL); |
| 43 |
| 39 return groups_with_unapplied_updates; | 44 return groups_with_unapplied_updates; |
| 40 } | 45 } |
| 41 | 46 |
| 42 SyncerError ApplyUpdatesCommand::ModelChangingExecuteImpl( | 47 SyncerError ApplyUpdatesCommand::ModelChangingExecuteImpl( |
| 43 SyncSession* session) { | 48 SyncSession* session) { |
| 44 syncable::Directory* dir = session->context()->directory(); | 49 syncable::Directory* dir = session->context()->directory(); |
| 45 syncable::WriteTransaction trans(FROM_HERE, syncable::SYNCER, dir); | 50 syncable::WriteTransaction trans(FROM_HERE, syncable::SYNCER, dir); |
| 46 | 51 |
| 47 // Compute server types with unapplied updates that fall under our | 52 // Compute server types with unapplied updates that fall under our |
| 48 // group restriction. | 53 // group restriction. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 79 status.updates_request_types().First(); it.Good(); it.Inc()) { | 84 status.updates_request_types().First(); it.Good(); it.Inc()) { |
| 80 // This gets persisted to the directory's backing store. | 85 // This gets persisted to the directory's backing store. |
| 81 dir->set_initial_sync_ended_for_type(it.Get(), true); | 86 dir->set_initial_sync_ended_for_type(it.Get(), true); |
| 82 } | 87 } |
| 83 } | 88 } |
| 84 | 89 |
| 85 return SYNCER_OK; | 90 return SYNCER_OK; |
| 86 } | 91 } |
| 87 | 92 |
| 88 } // namespace csync | 93 } // namespace csync |
| OLD | NEW |