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

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

Issue 11474036: Remove initial_sync_ended bits (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another rebase Created 8 years 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
« no previous file with comments | « sync/engine/all_status.cc ('k') | sync/engine/apply_control_data_updates_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 if (!entry.Get(syncable::UNIQUE_SERVER_TAG).empty()) { 72 if (!entry.Get(syncable::UNIQUE_SERVER_TAG).empty()) {
73 // We should have already applied all top level control nodes. 73 // We should have already applied all top level control nodes.
74 DCHECK(!entry.Get(syncable::IS_UNAPPLIED_UPDATE)); 74 DCHECK(!entry.Get(syncable::IS_UNAPPLIED_UPDATE));
75 continue; 75 continue;
76 } 76 }
77 77
78 ApplyControlUpdate(&trans, 78 ApplyControlUpdate(&trans,
79 &entry, 79 &entry,
80 dir->GetCryptographer(&trans)); 80 dir->GetCryptographer(&trans));
81 } 81 }
82
83 // Set initial sync ended bits for all control types requested.
84 for (ModelTypeSet::Iterator it =
85 session->status_controller().updates_request_types().First();
86 it.Good(); it.Inc()) {
87 if (!IsControlType(it.Get()))
88 continue;
89
90 // This gets persisted to the directory's backing store.
91 dir->set_initial_sync_ended_for_type(it.Get(), true);
92 }
93 } 82 }
94 83
95 // Update the nigori handler with the server's nigori node. 84 // Update the nigori handler with the server's nigori node.
96 // 85 //
97 // If we have a locally modified nigori node, we merge them manually. This 86 // If we have a locally modified nigori node, we merge them manually. This
98 // handles the case where two clients both set a different passphrase. The 87 // handles the case where two clients both set a different passphrase. The
99 // second client to attempt to commit will go into a state of having pending 88 // second client to attempt to commit will go into a state of having pending
100 // keys, unioned the set of encrypted types, and eventually re-encrypt 89 // keys, unioned the set of encrypted types, and eventually re-encrypt
101 // everything with the passphrase of the first client and commit the set of 90 // everything with the passphrase of the first client and commit the set of
102 // merged encryption keys. Until the second client provides the pending 91 // merged encryption keys. Until the second client provides the pending
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 ConflictResolver::OVERWRITE_LOCAL, 213 ConflictResolver::OVERWRITE_LOCAL,
225 ConflictResolver::CONFLICT_RESOLUTION_SIZE); 214 ConflictResolver::CONFLICT_RESOLUTION_SIZE);
226 } 215 }
227 216
228 UpdateAttemptResponse response = AttemptToUpdateEntry( 217 UpdateAttemptResponse response = AttemptToUpdateEntry(
229 trans, entry, cryptographer); 218 trans, entry, cryptographer);
230 DCHECK_EQ(SUCCESS, response); 219 DCHECK_EQ(SUCCESS, response);
231 } 220 }
232 221
233 } // namespace syncer 222 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/engine/all_status.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