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

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

Issue 7033043: [Sync] Speed up sync node browser/search in about:sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 6 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/conflict_resolver.h" 5 #include "chrome/browser/sync/engine/conflict_resolver.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 VLOG(1) << "Resolving simple conflict, overwriting server changes for:" 123 VLOG(1) << "Resolving simple conflict, overwriting server changes for:"
124 << entry; 124 << entry;
125 OverwriteServerChanges(trans, &entry); 125 OverwriteServerChanges(trans, &entry);
126 status->increment_num_server_overwrites(); 126 status->increment_num_server_overwrites();
127 } 127 }
128 return SYNC_PROGRESS; 128 return SYNC_PROGRESS;
129 } else { // SERVER_IS_DEL is true 129 } else { // SERVER_IS_DEL is true
130 // If a server deleted folder has local contents we should be in a set. 130 // If a server deleted folder has local contents we should be in a set.
131 if (entry.Get(syncable::IS_DIR)) { 131 if (entry.Get(syncable::IS_DIR)) {
132 Directory::ChildHandles children; 132 Directory::ChildHandles children;
133 trans->directory()->GetChildHandles(trans, 133 trans->directory()->GetChildHandlesById(trans,
134 entry.Get(syncable::ID), 134 entry.Get(syncable::ID),
135 &children); 135 &children);
136 if (0 != children.size()) { 136 if (0 != children.size()) {
137 VLOG(1) << "Entry is a server deleted directory with local contents, " 137 VLOG(1) << "Entry is a server deleted directory with local contents, "
138 "should be in a set. (race condition)."; 138 "should be in a set. (race condition).";
139 return NO_SYNC_PROGRESS; 139 return NO_SYNC_PROGRESS;
140 } 140 }
141 } 141 }
142 142
143 // The entry is deleted on the server but still exists locally. 143 // The entry is deleted on the server but still exists locally.
144 if (!entry.Get(syncable::UNIQUE_CLIENT_TAG).empty()) { 144 if (!entry.Get(syncable::UNIQUE_CLIENT_TAG).empty()) {
145 // If we've got a client-unique tag, we can undelete while retaining 145 // If we've got a client-unique tag, we can undelete while retaining
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 conflict_set_count_map_.erase(i++); 513 conflict_set_count_map_.erase(i++);
514 // METRIC self resolved conflict sets ++. 514 // METRIC self resolved conflict sets ++.
515 } else { 515 } else {
516 ++i; 516 ++i;
517 } 517 }
518 } 518 }
519 return rv; 519 return rv;
520 } 520 }
521 521
522 } // namespace browser_sync 522 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698