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/syncable/syncable.h" | 5 #include "sync/syncable/syncable.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstring> | 8 #include <cstring> |
9 #include <functional> | 9 #include <functional> |
10 #include <iomanip> | 10 #include <iomanip> |
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1729 | 1729 |
1730 bool MutableEntry::PutIsDel(bool is_del) { | 1730 bool MutableEntry::PutIsDel(bool is_del) { |
1731 DCHECK(kernel_); | 1731 DCHECK(kernel_); |
1732 if (is_del == kernel_->ref(IS_DEL)) { | 1732 if (is_del == kernel_->ref(IS_DEL)) { |
1733 return true; | 1733 return true; |
1734 } | 1734 } |
1735 if (is_del) { | 1735 if (is_del) { |
1736 if (!UnlinkFromOrder()) { | 1736 if (!UnlinkFromOrder()) { |
1737 return false; | 1737 return false; |
1738 } | 1738 } |
1739 // If this item was deleted before it hit the server, we know that no one | |
1740 // will attempt to undelete it. It's never going to make it to the server | |
Nicolas Zea
2012/05/11 23:21:25
"no one will attempt to undelete it" seems a bit m
rlarocque
2012/05/15 00:41:55
Will do. I was thinking mainly of bookmarks when
| |
1741 // either. Mark it as unsynced so we can drop it later in | |
Nicolas Zea
2012/05/11 23:21:25
Mark it as unsynced -> Unmark it as unsynced
| |
1742 // DropDeletedEntries(). See also: crbug.com/125381. | |
1743 if (!Get(ID).ServerKnows()) { | |
1744 Put(IS_UNSYNCED, false); | |
1745 } | |
1739 } | 1746 } |
1740 | 1747 |
1741 { | 1748 { |
1742 ScopedKernelLock lock(dir()); | 1749 ScopedKernelLock lock(dir()); |
1743 // Some indices don't include deleted items and must be updated | 1750 // Some indices don't include deleted items and must be updated |
1744 // upon a value change. | 1751 // upon a value change. |
1745 ScopedIndexUpdater<ParentIdAndHandleIndexer> updater(lock, kernel_, | 1752 ScopedIndexUpdater<ParentIdAndHandleIndexer> updater(lock, kernel_, |
1746 dir()->kernel_->parent_id_child_index); | 1753 dir()->kernel_->parent_id_child_index); |
1747 | 1754 |
1748 kernel_->put(IS_DEL, is_del); | 1755 kernel_->put(IS_DEL, is_del); |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2370 if (entry->ref(NEXT_ID).IsRoot() || | 2377 if (entry->ref(NEXT_ID).IsRoot() || |
2371 entry->ref(NEXT_ID) != entry->ref(PREV_ID)) { | 2378 entry->ref(NEXT_ID) != entry->ref(PREV_ID)) { |
2372 return entry; | 2379 return entry; |
2373 } | 2380 } |
2374 } | 2381 } |
2375 // There were no children in the linked list. | 2382 // There were no children in the linked list. |
2376 return NULL; | 2383 return NULL; |
2377 } | 2384 } |
2378 | 2385 |
2379 } // namespace syncable | 2386 } // namespace syncable |
OLD | NEW |