| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 base_server_specifics.SerializeAsString(); | 214 base_server_specifics.SerializeAsString(); |
| 215 } else { | 215 } else { |
| 216 decrypted_base_server_specifics = cryptographer->DecryptToString( | 216 decrypted_base_server_specifics = cryptographer->DecryptToString( |
| 217 base_server_specifics.encrypted()); | 217 base_server_specifics.encrypted()); |
| 218 } | 218 } |
| 219 if (decrypted_server_specifics == decrypted_base_server_specifics) | 219 if (decrypted_server_specifics == decrypted_base_server_specifics) |
| 220 base_server_specifics_match = true; | 220 base_server_specifics_match = true; |
| 221 } | 221 } |
| 222 | 222 |
| 223 // We manually merge nigori data. | 223 // We manually merge nigori data. |
| 224 if (entry.GetModelType() == syncer::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); |
| 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). |
| (...skipping 174 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 |