| 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 // Various utility methods for nigori-based multi-type encryption. | 5 // Various utility methods for nigori-based multi-type encryption. |
| 6 | 6 |
| 7 #ifndef SYNC_SYNCABLE_NIGORI_UTIL_H_ | 7 #ifndef SYNC_SYNCABLE_NIGORI_UTIL_H_ |
| 8 #define SYNC_SYNCABLE_NIGORI_UTIL_H_ | 8 #define SYNC_SYNCABLE_NIGORI_UTIL_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "sync/internal_api/public/syncable/model_type.h" | 12 #include "sync/internal_api/public/syncable/model_type.h" |
| 13 #include "sync/protocol/nigori_specifics.pb.h" | 13 #include "sync/protocol/nigori_specifics.pb.h" |
| 14 | 14 |
| 15 namespace syncer { | |
| 16 class Cryptographer; | |
| 17 } | |
| 18 | |
| 19 namespace sync_pb { | 15 namespace sync_pb { |
| 20 class EntitySpecifics; | 16 class EntitySpecifics; |
| 21 } | 17 } |
| 22 | 18 |
| 19 namespace syncer { |
| 20 class Cryptographer; |
| 21 |
| 23 namespace syncable { | 22 namespace syncable { |
| 24 | 23 |
| 25 const char kEncryptedString[] = "encrypted"; | 24 const char kEncryptedString[] = "encrypted"; |
| 26 | 25 |
| 27 class BaseTransaction; | 26 class BaseTransaction; |
| 28 class Entry; | 27 class Entry; |
| 29 class MutableEntry; | 28 class MutableEntry; |
| 30 class WriteTransaction; | 29 class WriteTransaction; |
| 31 | 30 |
| 32 // Check if our unsyced changes are encrypted if they need to be based on | 31 // Check if our unsyced changes are encrypted if they need to be based on |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 63 |
| 65 // Stores |new_specifics| into |entry|, encrypting if necessary. | 64 // Stores |new_specifics| into |entry|, encrypting if necessary. |
| 66 // Returns false if an error encrypting occurred (does not modify |entry|). | 65 // Returns false if an error encrypting occurred (does not modify |entry|). |
| 67 // Note: gracefully handles new_specifics aliasing with entry->Get(SPECIFICS). | 66 // Note: gracefully handles new_specifics aliasing with entry->Get(SPECIFICS). |
| 68 bool UpdateEntryWithEncryption( | 67 bool UpdateEntryWithEncryption( |
| 69 syncer::Cryptographer* cryptographer, | 68 syncer::Cryptographer* cryptographer, |
| 70 const sync_pb::EntitySpecifics& new_specifics, | 69 const sync_pb::EntitySpecifics& new_specifics, |
| 71 MutableEntry* entry); | 70 MutableEntry* entry); |
| 72 | 71 |
| 73 } // namespace syncable | 72 } // namespace syncable |
| 73 } // namespace syncer |
| 74 | 74 |
| 75 #endif // SYNC_SYNCABLE_NIGORI_UTIL_H_ | 75 #endif // SYNC_SYNCABLE_NIGORI_UTIL_H_ |
| OLD | NEW |