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/engine/conflict_resolver.h" | 5 #include "sync/engine/conflict_resolver.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 222 |
223 // We manually merge nigori data. | 223 // We manually merge nigori data. |
224 if (entry.GetModelType() == NIGORI) { | 224 if (entry.GetModelType() == NIGORI) { |
225 // Create a new set of specifics based on the server specifics (which | 225 // Create a new set of specifics based on the server specifics (which |
226 // preserves their encryption keys). | 226 // preserves their encryption keys). |
227 sync_pb::EntitySpecifics specifics = | 227 sync_pb::EntitySpecifics specifics = |
228 entry.Get(syncable::SERVER_SPECIFICS); | 228 entry.Get(syncable::SERVER_SPECIFICS); |
229 sync_pb::NigoriSpecifics* server_nigori = specifics.mutable_nigori(); | 229 sync_pb::NigoriSpecifics* server_nigori = specifics.mutable_nigori(); |
230 // Store the merged set of encrypted types (cryptographer->Update(..) will | 230 // Store the merged set of encrypted types (cryptographer->Update(..) will |
231 // have merged the local types already). | 231 // have merged the local types already). |
232 cryptographer->UpdateNigoriFromEncryptedTypes(server_nigori); | 232 cryptographer->UpdateNigoriFromEncryptedTypes(server_nigori, trans); |
233 // The cryptographer has the both the local and remote encryption keys | 233 // The cryptographer has the both the local and remote encryption keys |
234 // (added at cryptographer->Update(..) time). | 234 // (added at cryptographer->Update(..) time). |
235 // If the cryptographer is ready, then it already merged both sets of keys | 235 // If the cryptographer is ready, then it already merged both sets of keys |
236 // and we can store them back in. In that case, the remote key was already | 236 // and we can store them back in. In that case, the remote key was already |
237 // part of the local keybag, so we preserve the local key as the default | 237 // part of the local keybag, so we preserve the local key as the default |
238 // (including whether it's an explicit key). | 238 // (including whether it's an explicit key). |
239 // If the cryptographer is not ready, then the user will have to provide | 239 // If the cryptographer is not ready, then the user will have to provide |
240 // the passphrase to decrypt the pending keys. When they do so, the | 240 // the passphrase to decrypt the pending keys. When they do so, the |
241 // SetDecryptionPassphrase code will act based on whether the server | 241 // SetDecryptionPassphrase code will act based on whether the server |
242 // update has an explicit passphrase or not. | 242 // update has an explicit passphrase or not. |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 forward_progress = true; | 409 forward_progress = true; |
410 break; | 410 break; |
411 } | 411 } |
412 processed_items.insert(id); | 412 processed_items.insert(id); |
413 } | 413 } |
414 } | 414 } |
415 return forward_progress; | 415 return forward_progress; |
416 } | 416 } |
417 | 417 |
418 } // namespace syncer | 418 } // namespace syncer |
OLD | NEW |