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

Side by Side Diff: chrome/browser/sync/engine/syncer_util.cc

Issue 7822008: [Sync] Remove static initializers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to head Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/sync/engine/syncer_util.h" 5 #include "chrome/browser/sync/engine/syncer_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 if (local_entry.good()) { 167 if (local_entry.good()) {
168 if (local_entry.Get(ID).ServerKnows()) { 168 if (local_entry.Get(ID).ServerKnows()) {
169 if (local_entry.Get(ID) != update.id()) { 169 if (local_entry.Get(ID) != update.id()) {
170 // Case 2. 170 // Case 2.
171 LOG(WARNING) << "Duplicated client tag."; 171 LOG(WARNING) << "Duplicated client tag.";
172 if (local_entry.Get(ID) < update.id()) { 172 if (local_entry.Get(ID) < update.id()) {
173 // Signal an error; drop this update on the floor. Note that 173 // Signal an error; drop this update on the floor. Note that
174 // we don't server delete the item, because we don't allow it to 174 // we don't server delete the item, because we don't allow it to
175 // exist locally at all. So the item will remain orphaned on 175 // exist locally at all. So the item will remain orphaned on
176 // the server, and we won't pay attention to it. 176 // the server, and we won't pay attention to it.
177 return syncable::kNullId; 177 return syncable::GetNullId();
178 } 178 }
179 } 179 }
180 // Target this change to the existing local entry; later, 180 // Target this change to the existing local entry; later,
181 // we'll change the ID of the local entry to update.id() 181 // we'll change the ID of the local entry to update.id()
182 // if needed. 182 // if needed.
183 return local_entry.Get(ID); 183 return local_entry.Get(ID);
184 } else { 184 } else {
185 // Case 3: We have a local entry with the same client tag. 185 // Case 3: We have a local entry with the same client tag.
186 // We should change the ID of the local entry to the server entry. 186 // We should change the ID of the local entry to the server entry.
187 // This will result in an server ID with base version == 0, but that's 187 // This will result in an server ID with base version == 0, but that's
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 if (update.version() < target->Get(SERVER_VERSION)) { 829 if (update.version() < target->Get(SERVER_VERSION)) {
830 LOG(WARNING) << "Update older than current server version for " 830 LOG(WARNING) << "Update older than current server version for "
831 << *target << " Update:" 831 << *target << " Update:"
832 << SyncerProtoUtil::SyncEntityDebugString(update); 832 << SyncerProtoUtil::SyncEntityDebugString(update);
833 return VERIFY_SUCCESS; // Expected in new sync protocol. 833 return VERIFY_SUCCESS; // Expected in new sync protocol.
834 } 834 }
835 return VERIFY_UNDECIDED; 835 return VERIFY_UNDECIDED;
836 } 836 }
837 837
838 } // namespace browser_sync 838 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/syncer_unittest.cc ('k') | chrome/browser/sync/engine/verify_updates_command_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698