| OLD | NEW |
| 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/syncable/nigori_util.h" | 5 #include "sync/syncable/nigori_util.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
| 12 #include "sync/syncable/directory.h" | 12 #include "sync/syncable/directory.h" |
| 13 #include "sync/syncable/entry.h" | 13 #include "sync/syncable/entry.h" |
| 14 #include "sync/syncable/mutable_entry.h" | 14 #include "sync/syncable/mutable_entry.h" |
| 15 #include "sync/syncable/syncable_util.h" | 15 #include "sync/syncable/syncable_util.h" |
| 16 #include "sync/syncable/write_transaction.h" | 16 #include "sync/syncable/write_transaction.h" |
| 17 #include "sync/util/cryptographer.h" | 17 #include "sync/util/cryptographer.h" |
| 18 | 18 |
| 19 namespace syncer { |
| 19 namespace syncable { | 20 namespace syncable { |
| 20 | 21 |
| 21 bool ProcessUnsyncedChangesForEncryption( | 22 bool ProcessUnsyncedChangesForEncryption( |
| 22 WriteTransaction* const trans, | 23 WriteTransaction* const trans, |
| 23 syncer::Cryptographer* cryptographer) { | 24 syncer::Cryptographer* cryptographer) { |
| 24 DCHECK(cryptographer->is_ready()); | 25 DCHECK(cryptographer->is_ready()); |
| 25 // Get list of all datatypes with unsynced changes. It's possible that our | 26 // Get list of all datatypes with unsynced changes. It's possible that our |
| 26 // local changes need to be encrypted if encryption for that datatype was | 27 // local changes need to be encrypted if encryption for that datatype was |
| 27 // just turned on (and vice versa). | 28 // just turned on (and vice versa). |
| 28 // Note: we do not attempt to re-encrypt data with a new key here as key | 29 // Note: we do not attempt to re-encrypt data with a new key here as key |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 } | 241 } |
| 241 entry->Put(syncable::SPECIFICS, generated_specifics); | 242 entry->Put(syncable::SPECIFICS, generated_specifics); |
| 242 DVLOG(1) << "Overwriting specifics of type " | 243 DVLOG(1) << "Overwriting specifics of type " |
| 243 << syncable::ModelTypeToString(type) | 244 << syncable::ModelTypeToString(type) |
| 244 << " and marking for syncing."; | 245 << " and marking for syncing."; |
| 245 syncable::MarkForSyncing(entry); | 246 syncable::MarkForSyncing(entry); |
| 246 return true; | 247 return true; |
| 247 } | 248 } |
| 248 | 249 |
| 249 } // namespace syncable | 250 } // namespace syncable |
| 251 } // namespace syncer |
| OLD | NEW |