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

Unified Diff: chrome/browser/sync/glue/bookmark_model_associator.cc

Issue 9570055: [Sync] Add support for associating a new Synced Bookmarks node. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Caps Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/glue/bookmark_model_associator.cc
diff --git a/chrome/browser/sync/glue/bookmark_model_associator.cc b/chrome/browser/sync/glue/bookmark_model_associator.cc
index 42c730bbce1d881c855ab4c9aefb7d1858502f15..e533e3eba580b4ddefb54aff25aaa133b50da6f3 100644
--- a/chrome/browser/sync/glue/bookmark_model_associator.cc
+++ b/chrome/browser/sync/glue/bookmark_model_associator.cc
@@ -466,15 +466,17 @@ bool BookmarkModelAssociator::BuildAssociations(SyncError* error) {
child_node = BookmarkChangeProcessor::CreateBookmarkNode(
&sync_child_node, parent_node, bookmark_model_, index);
if (!child_node) {
- error->Reset(FROM_HERE,
- "Failed to create bookmark node with title " +
- sync_child_node.GetTitle() + " and url " +
- sync_child_node.GetURL().possibly_invalid_spec(),
- model_type());
- return false;
+ // This can happen if a sync bookmark node doesn't have a valid url.
+ // As far as we can tell, it appears this can only happen if something
+ // interrupts association. For now, we just ignore the bookmark.
+ LOG(ERROR) << "Failed to create bookmark node with title "
+ << sync_child_node.GetTitle() << " and url "
+ << sync_child_node.GetURL().possibly_invalid_spec();
}
}
- Associate(child_node, sync_child_id);
+ if (child_node) {
+ Associate(child_node, sync_child_id);
+ }
if (sync_child_node.GetIsFolder())
dfs_stack.push(sync_child_id);

Powered by Google App Engine
This is Rietveld 408576698