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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 DVLOG(1) << "Excluding entry from commit due to version mismatch " | 101 DVLOG(1) << "Excluding entry from commit due to version mismatch " |
102 << entry; | 102 << entry; |
103 return true; | 103 return true; |
104 } | 104 } |
105 return false; | 105 return false; |
106 } | 106 } |
107 | 107 |
108 // Return true if this entry has any attachments that haven't yet been uploaded | 108 // Return true if this entry has any attachments that haven't yet been uploaded |
109 // to the server. | 109 // to the server. |
110 bool HasAttachmentNotOnServer(const syncable::Entry& entry) { | 110 bool HasAttachmentNotOnServer(const syncable::Entry& entry) { |
111 // TODO(maniscalco): Add test case (bug 356266). | |
112 const sync_pb::AttachmentMetadata& metadata = entry.GetAttachmentMetadata(); | 111 const sync_pb::AttachmentMetadata& metadata = entry.GetAttachmentMetadata(); |
113 for (int i = 0; i < metadata.record_size(); ++i) { | 112 for (int i = 0; i < metadata.record_size(); ++i) { |
114 if (!metadata.record(i).is_on_server()) { | 113 if (!metadata.record(i).is_on_server()) { |
115 return true; | 114 return true; |
116 } | 115 } |
117 } | 116 } |
118 return false; | 117 return false; |
119 } | 118 } |
120 | 119 |
121 // An entry is not considered ready for commit if any are true: | 120 // An entry is not considered ready for commit if any are true: |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 // Add moves and creates, and prepend their uncommitted parents. | 523 // Add moves and creates, and prepend their uncommitted parents. |
525 traversal.AddCreatesAndMoves(ready_unsynced_set); | 524 traversal.AddCreatesAndMoves(ready_unsynced_set); |
526 | 525 |
527 // Add all deletes. | 526 // Add all deletes. |
528 traversal.AddDeletes(ready_unsynced_set); | 527 traversal.AddDeletes(ready_unsynced_set); |
529 } | 528 } |
530 | 529 |
531 } // namespace | 530 } // namespace |
532 | 531 |
533 } // namespace syncer | 532 } // namespace syncer |
OLD | NEW |