| 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 18 matching lines...) Expand all Loading... |
| 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 (FullModelTypeSet::Iterator it = | 33 for (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 groups_with_unapplied_updates.insert( | 35 groups_with_unapplied_updates.insert( |
| 36 GetGroupForModelType(it.Get(), session.routing_info())); | 36 GetGroupForModelType(it.Get(), session.routing_info())); |
| 37 } | 37 } |
| 38 | 38 |
| 39 // The INTERNAL types are special. They have their own update routines, |
| 40 // ApplyUpdatesCommand should not process them. |
| 41 groups_with_unapplied_updates.erase(GROUP_CONTROL); |
| 42 |
| 39 return groups_with_unapplied_updates; | 43 return groups_with_unapplied_updates; |
| 40 } | 44 } |
| 41 | 45 |
| 42 SyncerError ApplyUpdatesCommand::ModelChangingExecuteImpl( | 46 SyncerError ApplyUpdatesCommand::ModelChangingExecuteImpl( |
| 43 SyncSession* session) { | 47 SyncSession* session) { |
| 44 syncable::Directory* dir = session->context()->directory(); | 48 syncable::Directory* dir = session->context()->directory(); |
| 45 syncable::WriteTransaction trans(FROM_HERE, syncable::SYNCER, dir); | 49 syncable::WriteTransaction trans(FROM_HERE, syncable::SYNCER, dir); |
| 46 | 50 |
| 47 // Compute server types with unapplied updates that fall under our | 51 // Compute server types with unapplied updates that fall under our |
| 48 // group restriction. | 52 // group restriction. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 79 status.updates_request_types().First(); it.Good(); it.Inc()) { | 83 status.updates_request_types().First(); it.Good(); it.Inc()) { |
| 80 // This gets persisted to the directory's backing store. | 84 // This gets persisted to the directory's backing store. |
| 81 dir->set_initial_sync_ended_for_type(it.Get(), true); | 85 dir->set_initial_sync_ended_for_type(it.Get(), true); |
| 82 } | 86 } |
| 83 } | 87 } |
| 84 | 88 |
| 85 return SYNCER_OK; | 89 return SYNCER_OK; |
| 86 } | 90 } |
| 87 | 91 |
| 88 } // namespace syncer | 92 } // namespace syncer |
| OLD | NEW |