| 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_and_resolve_conflicts_command.h" | 5 #include "sync/engine/apply_updates_and_resolve_conflicts_command.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "sync/engine/conflict_resolver.h" | 8 #include "sync/engine/conflict_resolver.h" |
| 9 #include "sync/engine/update_applicator.h" | 9 #include "sync/engine/update_applicator.h" |
| 10 #include "sync/sessions/sync_session.h" | 10 #include "sync/sessions/sync_session.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 DCHECK_EQ(conflict_applicator.hierarchy_conflicts(), | 121 DCHECK_EQ(conflict_applicator.hierarchy_conflicts(), |
| 122 applicator.hierarchy_conflicts()); | 122 applicator.hierarchy_conflicts()); |
| 123 | 123 |
| 124 // There should be no simple conflicts remaining. We know this because the | 124 // There should be no simple conflicts remaining. We know this because the |
| 125 // resolver should have resolved all the conflicts we detected last time | 125 // resolver should have resolved all the conflicts we detected last time |
| 126 // and, by the two previous assertions, that no conflicts have been | 126 // and, by the two previous assertions, that no conflicts have been |
| 127 // downgraded from encryption or hierarchy down to simple. | 127 // downgraded from encryption or hierarchy down to simple. |
| 128 DCHECK(conflict_applicator.simple_conflict_ids().empty()); | 128 DCHECK(conflict_applicator.simple_conflict_ids().empty()); |
| 129 } | 129 } |
| 130 | 130 |
| 131 // This might be the first time we've fully completed a sync cycle, for | |
| 132 // some subset of the currently synced datatypes. | |
| 133 if (status->ServerSaysNothingMoreToDownload()) { | |
| 134 for (ModelTypeSet::Iterator it = | |
| 135 status->updates_request_types().First(); it.Good(); it.Inc()) { | |
| 136 // Don't set the flag for control types. We didn't process them here. | |
| 137 if (IsControlType(it.Get())) | |
| 138 continue; | |
| 139 | |
| 140 // This gets persisted to the directory's backing store. | |
| 141 dir->set_initial_sync_ended_for_type(it.Get(), true); | |
| 142 } | |
| 143 } | |
| 144 | |
| 145 return SYNCER_OK; | 131 return SYNCER_OK; |
| 146 } | 132 } |
| 147 | 133 |
| 148 } // namespace syncer | 134 } // namespace syncer |
| OLD | NEW |