OLD | NEW |
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 |
11 #include "chrome/browser/sync/engine/nigori_util.h" | 11 #include "chrome/browser/sync/encryption/nigori_util.h" |
12 #include "chrome/browser/sync/engine/syncer_util.h" | 12 #include "chrome/browser/sync/engine/syncer_util.h" |
13 #include "chrome/browser/sync/syncable/directory_manager.h" | 13 #include "chrome/browser/sync/syncable/directory_manager.h" |
14 #include "chrome/browser/sync/syncable/syncable.h" | 14 #include "chrome/browser/sync/syncable/syncable.h" |
15 #include "chrome/browser/sync/util/cryptographer.h" | 15 #include "chrome/browser/sync/encryption/cryptographer.h" |
16 | 16 |
17 using std::set; | 17 using std::set; |
18 using std::vector; | 18 using std::vector; |
19 | 19 |
20 namespace browser_sync { | 20 namespace browser_sync { |
21 | 21 |
22 using sessions::OrderedCommitSet; | 22 using sessions::OrderedCommitSet; |
23 using sessions::SyncSession; | 23 using sessions::SyncSession; |
24 using sessions::StatusController; | 24 using sessions::StatusController; |
25 | 25 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // conflict, so there's no point in attempting to commit. | 82 // conflict, so there's no point in attempting to commit. |
83 DCHECK(entry.Get(syncable::IS_UNAPPLIED_UPDATE)); // In conflict. | 83 DCHECK(entry.Get(syncable::IS_UNAPPLIED_UPDATE)); // In conflict. |
84 // TODO(zea): switch this to DVLOG once it's clear bug 100660 is fixed. | 84 // TODO(zea): switch this to DVLOG once it's clear bug 100660 is fixed. |
85 VLOG(1) << "Excluding entry from commit due to version mismatch " | 85 VLOG(1) << "Excluding entry from commit due to version mismatch " |
86 << entry; | 86 << entry; |
87 return false; | 87 return false; |
88 } | 88 } |
89 | 89 |
90 if (encrypted_types.count(entry.GetModelType()) > 0 && | 90 if (encrypted_types.count(entry.GetModelType()) > 0 && |
91 (passphrase_missing || | 91 (passphrase_missing || |
92 syncable::EntryNeedsEncryption(encrypted_types, entry))) { | 92 browser_sync::encryption::EntryNeedsEncryption(encrypted_types, entry))) { |
93 // This entry requires encryption but is not properly encrypted (possibly | 93 // This entry requires encryption but is not properly encrypted (possibly |
94 // due to the cryptographer not being initialized or the user hasn't | 94 // due to the cryptographer not being initialized or the user hasn't |
95 // provided the most recent passphrase). | 95 // provided the most recent passphrase). |
96 // TODO(zea): switch this to DVLOG once it's clear bug 100660 is fixed. | 96 // TODO(zea): switch this to DVLOG once it's clear bug 100660 is fixed. |
97 VLOG(1) << "Excluding entry from commit due to lack of encryption " | 97 VLOG(1) << "Excluding entry from commit due to lack of encryption " |
98 << entry; | 98 << entry; |
99 return false; | 99 return false; |
100 } | 100 } |
101 | 101 |
102 return true; | 102 return true; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 // delete trees. | 325 // delete trees. |
326 | 326 |
327 // Add moves and creates, and prepend their uncommitted parents. | 327 // Add moves and creates, and prepend their uncommitted parents. |
328 AddCreatesAndMoves(unsynced_handles, write_transaction, routes); | 328 AddCreatesAndMoves(unsynced_handles, write_transaction, routes); |
329 | 329 |
330 // Add all deletes. | 330 // Add all deletes. |
331 AddDeletes(unsynced_handles, write_transaction); | 331 AddDeletes(unsynced_handles, write_transaction); |
332 } | 332 } |
333 | 333 |
334 } // namespace browser_sync | 334 } // namespace browser_sync |
OLD | NEW |