Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: sync/engine/get_commit_ids.cc

Issue 393083004: Update Commit and GetUpdatesResponse messages to include attachment ids. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update SyncManagerImpl to detect attachment metadata changes. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/engine/directory_update_handler_unittest.cc ('k') | sync/engine/syncer_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « sync/engine/directory_update_handler_unittest.cc ('k') | sync/engine/syncer_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698