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

Side by Side Diff: chrome/browser/sync/glue/bookmark_model_associator.cc

Issue 1207483006: Sync: Report unmatched unassociated node during optimistic bookmark association. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/browser/sync/glue/bookmark_model_associator.h" 5 #include "chrome/browser/sync/glue/bookmark_model_associator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 // There is another matching node which means the local node 856 // There is another matching node which means the local node
857 // has been either moved or edited. 857 // has been either moved or edited.
858 // In this case assume the local model to be correct, delete the 858 // In this case assume the local model to be correct, delete the
859 // sync node, and let the matching node to be propagated to Sync. 859 // sync node, and let the matching node to be propagated to Sync.
860 // TODO(stanisc): crbug/456876: this should really be handled with 860 // TODO(stanisc): crbug/456876: this should really be handled with
861 // a move, but the move depends on the traversal order. 861 // a move, but the move depends on the traversal order.
862 int num = RemoveSyncNodeHierarchy(trans, sync_child_node.GetId()); 862 int num = RemoveSyncNodeHierarchy(trans, sync_child_node.GetId());
863 context->IncrementSyncItemsDeleted(num); 863 context->IncrementSyncItemsDeleted(num);
864 continue; 864 continue;
865 } 865 }
866 } else {
867 // Existing sync node isn't associated. This is unexpected during
868 // optimistic association unless there the previous association failed
869 // to
870 // persist extern IDs (that might be the case because persisting
871 // external
872 // IDs is delayed).
873 // Report this error only once per session.
874 static bool g_unmatched_unassociated_node_reported = false;
875 if (!g_unmatched_unassociated_node_reported) {
876 g_unmatched_unassociated_node_reported = true;
877 unrecoverable_error_handler_->CreateAndUploadError(
878 FROM_HERE,
879 "Unassociated sync node detected during optimistic association",
880 model_type());
881 }
866 } 882 }
867 883
868 syncer::SyncError error; 884 syncer::SyncError error;
869 child_node = CreateBookmarkNode(parent_node, index, &sync_child_node, url, 885 child_node = CreateBookmarkNode(parent_node, index, &sync_child_node, url,
870 context, &error); 886 context, &error);
871 if (!child_node) { 887 if (!child_node) {
872 if (error.IsSet()) { 888 if (error.IsSet()) {
873 return error; 889 return error;
874 } else { 890 } else {
875 // Skip this node and continue. Don't increment index in this case. 891 // Skip this node and continue. Don't increment index in this case.
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 syncer::BOOKMARKS); 1189 syncer::BOOKMARKS);
1174 } else { 1190 } else {
1175 context->set_native_model_sync_state(BEHIND); 1191 context->set_native_model_sync_state(BEHIND);
1176 } 1192 }
1177 } 1193 }
1178 } 1194 }
1179 return syncer::SyncError(); 1195 return syncer::SyncError();
1180 } 1196 }
1181 1197
1182 } // namespace browser_sync 1198 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698