OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/syncer_util.h" | 5 #include "sync/engine/syncer_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 } | 260 } |
261 if (entry->GetParentId() != new_parent) { | 261 if (entry->GetParentId() != new_parent) { |
262 if (!entry->GetIsDel() && !IsLegalNewParent(trans, id, new_parent)) { | 262 if (!entry->GetIsDel() && !IsLegalNewParent(trans, id, new_parent)) { |
263 DVLOG(1) << "Not updating item " << id | 263 DVLOG(1) << "Not updating item " << id |
264 << ", illegal new parent (would cause loop)."; | 264 << ", illegal new parent (would cause loop)."; |
265 return CONFLICT_HIERARCHY; | 265 return CONFLICT_HIERARCHY; |
266 } | 266 } |
267 } | 267 } |
268 } else { | 268 } else { |
269 // new_parent is unset. | 269 // new_parent is unset. |
270 DCHECK(!IsTypeWithServerGeneratedRoot(type)); | 270 DCHECK(IsTypeWithClientGeneratedRoot(type)); |
271 } | 271 } |
272 } else if (entry->GetIsDir()) { | 272 } else if (entry->GetIsDir()) { |
273 Directory::Metahandles handles; | 273 Directory::Metahandles handles; |
274 trans->directory()->GetChildHandlesById(trans, id, &handles); | 274 trans->directory()->GetChildHandlesById(trans, id, &handles); |
275 if (!handles.empty()) { | 275 if (!handles.empty()) { |
276 // If we have still-existing children, then we need to deal with | 276 // If we have still-existing children, then we need to deal with |
277 // them before we can process this change. | 277 // them before we can process this change. |
278 DVLOG(1) << "Not deleting directory; it's not empty " << *entry; | 278 DVLOG(1) << "Not deleting directory; it's not empty " << *entry; |
279 return CONFLICT_HIERARCHY; | 279 return CONFLICT_HIERARCHY; |
280 } | 280 } |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 if (update.version() < target->GetServerVersion()) { | 669 if (update.version() < target->GetServerVersion()) { |
670 LOG(WARNING) << "Update older than current server version for " | 670 LOG(WARNING) << "Update older than current server version for " |
671 << *target << " Update:" | 671 << *target << " Update:" |
672 << SyncerProtoUtil::SyncEntityDebugString(update); | 672 << SyncerProtoUtil::SyncEntityDebugString(update); |
673 return VERIFY_SUCCESS; // Expected in new sync protocol. | 673 return VERIFY_SUCCESS; // Expected in new sync protocol. |
674 } | 674 } |
675 return VERIFY_UNDECIDED; | 675 return VERIFY_UNDECIDED; |
676 } | 676 } |
677 | 677 |
678 } // namespace syncer | 678 } // namespace syncer |
OLD | NEW |