OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/get_commit_ids.h" | 5 #include "sync/engine/get_commit_ids.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 | 446 |
447 bool Traversal::IsFull() const { | 447 bool Traversal::IsFull() const { |
448 return out_->size() >= max_entries_; | 448 return out_->size() >= max_entries_; |
449 } | 449 } |
450 | 450 |
451 bool Traversal::HaveItem(int64 handle) const { | 451 bool Traversal::HaveItem(int64 handle) const { |
452 return added_handles_.find(handle) != added_handles_.end(); | 452 return added_handles_.find(handle) != added_handles_.end(); |
453 } | 453 } |
454 | 454 |
455 bool Traversal::SupportsHierarchy(const syncable::Entry& item) const { | 455 bool Traversal::SupportsHierarchy(const syncable::Entry& item) const { |
456 return !item.GetParentId().IsNull(); | 456 // Types with explicit server supported hierarchy only. |
| 457 return IsTypeWithServerGeneratedRoot(item.GetModelType()); |
457 } | 458 } |
458 | 459 |
459 void Traversal::AppendManyToTraversal( | 460 void Traversal::AppendManyToTraversal( |
460 const syncable::Directory::Metahandles& handles) { | 461 const syncable::Directory::Metahandles& handles) { |
461 out_->insert(out_->end(), handles.begin(), handles.end()); | 462 out_->insert(out_->end(), handles.begin(), handles.end()); |
462 added_handles_.insert(handles.begin(), handles.end()); | 463 added_handles_.insert(handles.begin(), handles.end()); |
463 } | 464 } |
464 | 465 |
465 void Traversal::AppendToTraversal(int64 metahandle) { | 466 void Traversal::AppendToTraversal(int64 metahandle) { |
466 out_->push_back(metahandle); | 467 out_->push_back(metahandle); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 // Add moves and creates, and prepend their uncommitted parents. | 571 // Add moves and creates, and prepend their uncommitted parents. |
571 traversal.AddCreatesAndMoves(ready_unsynced_set); | 572 traversal.AddCreatesAndMoves(ready_unsynced_set); |
572 | 573 |
573 // Add all deletes. | 574 // Add all deletes. |
574 traversal.AddDeletes(ready_unsynced_set); | 575 traversal.AddDeletes(ready_unsynced_set); |
575 } | 576 } |
576 | 577 |
577 } // namespace | 578 } // namespace |
578 | 579 |
579 } // namespace syncer | 580 } // namespace syncer |
OLD | NEW |