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

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

Issue 8856007: [Sync] Special case nigori when calculating commit id's. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/sync/engine/get_commit_ids_command.h" 5 #include "chrome/browser/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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // The local and server versions don't match. The item must be in 87 // The local and server versions don't match. The item must be in
88 // conflict, so there's no point in attempting to commit. 88 // conflict, so there's no point in attempting to commit.
89 DCHECK(entry.Get(syncable::IS_UNAPPLIED_UPDATE)); // In conflict. 89 DCHECK(entry.Get(syncable::IS_UNAPPLIED_UPDATE)); // In conflict.
90 // TODO(zea): switch this to DVLOG once it's clear bug 100660 is fixed. 90 // TODO(zea): switch this to DVLOG once it's clear bug 100660 is fixed.
91 DVLOG(1) << "Excluding entry from commit due to version mismatch " 91 DVLOG(1) << "Excluding entry from commit due to version mismatch "
92 << entry; 92 << entry;
93 return false; 93 return false;
94 } 94 }
95 95
96 syncable::ModelType type = entry.GetModelType(); 96 syncable::ModelType type = entry.GetModelType();
97 if (encrypted_types.count(type) > 0 && 97 // We special case the nigori node because even though it is considered an
98 // "encrypted type", not all nigori node changes require valid encryption
99 // (ex: sync_tabs).
100 if (type != syncable::NIGORI &&
101 encrypted_types.count(type) > 0 &&
98 (passphrase_missing || 102 (passphrase_missing ||
99 syncable::EntryNeedsEncryption(encrypted_types, entry))) { 103 syncable::EntryNeedsEncryption(encrypted_types, entry))) {
100 // This entry requires encryption but is not properly encrypted (possibly 104 // This entry requires encryption but is not properly encrypted (possibly
101 // due to the cryptographer not being initialized or the user hasn't 105 // due to the cryptographer not being initialized or the user hasn't
102 // provided the most recent passphrase). 106 // provided the most recent passphrase).
103 // TODO(zea): switch this to DVLOG once it's clear bug 100660 is fixed. 107 // TODO(zea): switch this to DVLOG once it's clear bug 100660 is fixed.
104 DVLOG(1) << "Excluding entry from commit due to lack of encryption " 108 DVLOG(1) << "Excluding entry from commit due to lack of encryption "
105 << entry; 109 << entry;
106 return false; 110 return false;
107 } 111 }
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 354
351 // Add moves and creates, and prepend their uncommitted parents. 355 // Add moves and creates, and prepend their uncommitted parents.
352 AddCreatesAndMoves(unsynced_handles, write_transaction, routes, 356 AddCreatesAndMoves(unsynced_handles, write_transaction, routes,
353 throttled_types); 357 throttled_types);
354 358
355 // Add all deletes. 359 // Add all deletes.
356 AddDeletes(unsynced_handles, write_transaction); 360 AddDeletes(unsynced_handles, write_transaction);
357 } 361 }
358 362
359 } // namespace browser_sync 363 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698