OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 if (specifics.has_encrypted() != is_encrypted) | 144 if (specifics.has_encrypted() != is_encrypted) |
145 return false; | 145 return false; |
146 if (specifics.has_encrypted()) { | 146 if (specifics.has_encrypted()) { |
147 if (child.Get(NON_UNIQUE_NAME) != kEncryptedString) | 147 if (child.Get(NON_UNIQUE_NAME) != kEncryptedString) |
148 return false; | 148 return false; |
149 if (!cryptographer->CanDecryptUsingDefaultKey(specifics.encrypted())) | 149 if (!cryptographer->CanDecryptUsingDefaultKey(specifics.encrypted())) |
150 return false; | 150 return false; |
151 } | 151 } |
152 } | 152 } |
153 // Push the successor. | 153 // Push the successor. |
154 to_visit.push(child.Get(NEXT_ID)); | 154 to_visit.push(child.GetSuccessorId()); |
155 } | 155 } |
156 return true; | 156 return true; |
157 } | 157 } |
158 | 158 |
159 bool UpdateEntryWithEncryption( | 159 bool UpdateEntryWithEncryption( |
160 BaseTransaction* const trans, | 160 BaseTransaction* const trans, |
161 const sync_pb::EntitySpecifics& new_specifics, | 161 const sync_pb::EntitySpecifics& new_specifics, |
162 syncable::MutableEntry* entry) { | 162 syncable::MutableEntry* entry) { |
163 NigoriHandler* nigori_handler = trans->directory()->GetNigoriHandler(); | 163 NigoriHandler* nigori_handler = trans->directory()->GetNigoriHandler(); |
164 Cryptographer* cryptographer = trans->directory()->GetCryptographer(trans); | 164 Cryptographer* cryptographer = trans->directory()->GetCryptographer(trans); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 encrypted_types.Put(APP_SETTINGS); | 308 encrypted_types.Put(APP_SETTINGS); |
309 if (nigori.encrypt_apps()) | 309 if (nigori.encrypt_apps()) |
310 encrypted_types.Put(APPS); | 310 encrypted_types.Put(APPS); |
311 if (nigori.encrypt_app_notifications()) | 311 if (nigori.encrypt_app_notifications()) |
312 encrypted_types.Put(APP_NOTIFICATIONS); | 312 encrypted_types.Put(APP_NOTIFICATIONS); |
313 return encrypted_types; | 313 return encrypted_types; |
314 } | 314 } |
315 | 315 |
316 } // namespace syncable | 316 } // namespace syncable |
317 } // namespace syncer | 317 } // namespace syncer |
OLD | NEW |