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). | 111 // TODO(maniscalco): Once AttachmentMetadata is fleshed out, implement this |
112 const sync_pb::AttachmentMetadata& metadata = entry.GetAttachmentMetadata(); | 112 // function to return true if any of the attachments haven't been uploaded to |
113 for (int i = 0; i < metadata.record_size(); ++i) { | 113 // the server. Add test case (bug 356266). |
114 if (!metadata.record(i).is_on_server()) { | |
115 return true; | |
116 } | |
117 } | |
118 return false; | 114 return false; |
119 } | 115 } |
120 | 116 |
121 // An entry is not considered ready for commit if any are true: | 117 // An entry is not considered ready for commit if any are true: |
122 // 1. It's in conflict. | 118 // 1. It's in conflict. |
123 // 2. It requires encryption (either the type is encrypted but a passphrase | 119 // 2. It requires encryption (either the type is encrypted but a passphrase |
124 // is missing from the cryptographer, or the entry itself wasn't properly | 120 // is missing from the cryptographer, or the entry itself wasn't properly |
125 // encrypted). | 121 // encrypted). |
126 // 3. It's type is currently throttled. | 122 // 3. It's type is currently throttled. |
127 // 4. It's a delete but has not been committed. | 123 // 4. It's a delete but has not been committed. |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 // Add moves and creates, and prepend their uncommitted parents. | 520 // Add moves and creates, and prepend their uncommitted parents. |
525 traversal.AddCreatesAndMoves(ready_unsynced_set); | 521 traversal.AddCreatesAndMoves(ready_unsynced_set); |
526 | 522 |
527 // Add all deletes. | 523 // Add all deletes. |
528 traversal.AddDeletes(ready_unsynced_set); | 524 traversal.AddDeletes(ready_unsynced_set); |
529 } | 525 } |
530 | 526 |
531 } // namespace | 527 } // namespace |
532 | 528 |
533 } // namespace syncer | 529 } // namespace syncer |
OLD | NEW |