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

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

Issue 10389103: Sync: Clear IS_UNSYNCED for deleted local items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix check_deps issue by moving ChangeEntryIDAndUpdateChildren Created 8 years, 7 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
OLDNEW
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/engine/get_commit_ids_command.h" 5 #include "sync/engine/get_commit_ids_command.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // provided the most recent passphrase). 120 // provided the most recent passphrase).
121 DVLOG(1) << "Excluding entry from commit due to lack of encryption " 121 DVLOG(1) << "Excluding entry from commit due to lack of encryption "
122 << entry; 122 << entry;
123 return false; 123 return false;
124 } 124 }
125 125
126 // Look at the throttled types. 126 // Look at the throttled types.
127 if (throttled_types.Has(type)) 127 if (throttled_types.Has(type))
128 return false; 128 return false;
129 129
130 // Drop deleted uncommitted entries.
131 if (entry.Get(syncable::IS_DEL) && !entry.Get(syncable::ID).ServerKnows()) {
132 // TODO(zea): These will remain unsynced indefinitely. This is harmless,
133 // but we should clean them up somewhere.
134 DVLOG(1) << "Ignoring deleted and uncommitted item." << entry;
135 return false;
136 }
137
138 // Extra validity checks. 130 // Extra validity checks.
139 syncable::Id id = entry.Get(syncable::ID); 131 syncable::Id id = entry.Get(syncable::ID);
140 if (id == entry.Get(syncable::PARENT_ID)) { 132 if (id == entry.Get(syncable::PARENT_ID)) {
141 CHECK(id.IsRoot()) << "Non-root item is self parenting." << entry; 133 CHECK(id.IsRoot()) << "Non-root item is self parenting." << entry;
142 // If the root becomes unsynced it can cause us problems. 134 // If the root becomes unsynced it can cause us problems.
143 NOTREACHED() << "Root item became unsynced " << entry; 135 NOTREACHED() << "Root item became unsynced " << entry;
144 return false; 136 return false;
145 } 137 }
146 138
147 if (entry.IsRoot()) { 139 if (entry.IsRoot()) {
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 // delete trees. 417 // delete trees.
426 418
427 // Add moves and creates, and prepend their uncommitted parents. 419 // Add moves and creates, and prepend their uncommitted parents.
428 AddCreatesAndMoves(write_transaction, routes, ready_unsynced_set); 420 AddCreatesAndMoves(write_transaction, routes, ready_unsynced_set);
429 421
430 // Add all deletes. 422 // Add all deletes.
431 AddDeletes(write_transaction, ready_unsynced_set); 423 AddDeletes(write_transaction, ready_unsynced_set);
432 } 424 }
433 425
434 } // namespace browser_sync 426 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | sync/engine/process_commit_response_command.cc » ('j') | sync/engine/syncer_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698