Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Side by Side Diff: sync/engine/apply_control_data_updates.cc

Issue 10916036: [Sync] Implement keystore migration support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/apply_control_data_updates.h" 5 #include "sync/engine/apply_control_data_updates.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "sync/engine/conflict_resolver.h" 8 #include "sync/engine/conflict_resolver.h"
9 #include "sync/engine/conflict_util.h" 9 #include "sync/engine/conflict_util.h"
10 #include "sync/engine/syncer_util.h" 10 #include "sync/engine/syncer_util.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // default encryption key marked as an implicit passphrase. 110 // default encryption key marked as an implicit passphrase.
111 // This works fine except for the case where we had locally set an 111 // This works fine except for the case where we had locally set an
112 // explicit passphrase. In that case the nigori node will have the default 112 // explicit passphrase. In that case the nigori node will have the default
113 // key based on the local explicit passphassphrase, but will not have it 113 // key based on the local explicit passphassphrase, but will not have it
114 // marked as explicit. To fix this we'd have to track whether we have a 114 // marked as explicit. To fix this we'd have to track whether we have a
115 // explicit passphrase or not separate from the nigori, which would 115 // explicit passphrase or not separate from the nigori, which would
116 // introduce even more complexity, so we leave it up to the user to reset 116 // introduce even more complexity, so we leave it up to the user to reset
117 // that passphrase as an explicit one via settings. The goal here is to 117 // that passphrase as an explicit one via settings. The goal here is to
118 // ensure both sets of encryption keys are preserved. 118 // ensure both sets of encryption keys are preserved.
119 if (cryptographer->is_ready()) { 119 if (cryptographer->is_ready()) {
120 cryptographer->GetKeys(server_nigori->mutable_encrypted()); 120 cryptographer->GetKeys(server_nigori->mutable_encryption_keybag());
121 server_nigori->set_using_explicit_passphrase( 121 server_nigori->set_keybag_is_frozen(
122 nigori_node.Get(SPECIFICS).nigori().using_explicit_passphrase()); 122 nigori_node.Get(SPECIFICS).nigori().keybag_is_frozen());
123 } 123 }
124 nigori_node.Put(SPECIFICS, specifics); 124 nigori_node.Put(SPECIFICS, specifics);
125 DVLOG(1) << "Resolving simple conflict, merging nigori nodes: " 125 DVLOG(1) << "Resolving simple conflict, merging nigori nodes: "
126 << nigori_node; 126 << nigori_node;
127 127
128 OverwriteServerChanges(&nigori_node); 128 OverwriteServerChanges(&nigori_node);
129 129
130 UMA_HISTOGRAM_ENUMERATION("Sync.ResolveSimpleConflict", 130 UMA_HISTOGRAM_ENUMERATION("Sync.ResolveSimpleConflict",
131 ConflictResolver::NIGORI_MERGE, 131 ConflictResolver::NIGORI_MERGE,
132 ConflictResolver::CONFLICT_RESOLUTION_SIZE); 132 ConflictResolver::CONFLICT_RESOLUTION_SIZE);
133 } 133 }
134 134
135 return true; 135 return true;
136 } 136 }
137 137
138 } // namespace syncer 138 } // namespace syncer
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host.cc ('k') | sync/engine/apply_control_data_updates_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698