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

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

Issue 8790008: Changes BookmarkModelAssociator not to fail if mobile folder doesn't (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a010fadbfaea0412881632a55154c3379e131384..573606e98ed44148d297160081f0676fa924a578 100644
--- a/chrome/browser/sync/glue/bookmark_model_associator.cc
+++ b/chrome/browser/sync/glue/bookmark_model_associator.cc
@@ -368,11 +368,10 @@ bool BookmarkModelAssociator::BuildAssociations(SyncError* error) {
error->Reset(FROM_HERE, kServerError, model_type());
return false;
}
- if (!AssociateTaggedPermanentNode(bookmark_model_->mobile_node(),
- kMobileBookmarksTag)) {
- error->Reset(FROM_HERE, kServerError, model_type());
- return false;
- }
+ // The mobile folder isn't always present on the backend, so we don't fail if
+ // it doesn't exist.
+ AssociateTaggedPermanentNode(bookmark_model_->mobile_node(),
akalin 2011/12/03 00:12:20 #include compiler specific and use ignore_result
+ kMobileBookmarksTag);
int64 bookmark_bar_sync_id = GetSyncIdFromChromeId(
bookmark_model_->bookmark_bar_node()->id());
DCHECK_NE(bookmark_bar_sync_id, sync_api::kInvalidId);
@@ -381,7 +380,6 @@ bool BookmarkModelAssociator::BuildAssociations(SyncError* error) {
DCHECK_NE(other_bookmarks_sync_id, sync_api::kInvalidId);
int64 mobile_bookmarks_sync_id = GetSyncIdFromChromeId(
bookmark_model_->mobile_node()->id());
- DCHECK_NE(mobile_bookmarks_sync_id, sync_api::kInvalidId);
std::stack<int64> dfs_stack;
if (mobile_bookmarks_sync_id != sync_api::kInvalidId)
@@ -525,10 +523,7 @@ bool BookmarkModelAssociator::LoadAssociations() {
return false;
}
int64 mobile_bookmarks_id = -1;
- if (!GetSyncIdForTaggedNode(kMobileBookmarksTag, &mobile_bookmarks_id)) {
- // We should always be able to find the permanent nodes.
- return false;
- }
+ GetSyncIdForTaggedNode(kMobileBookmarksTag, &mobile_bookmarks_id);
akalin 2011/12/03 00:12:20 here, too
// Build a bookmark node ID index since we are going to repeatedly search for
// bookmark nodes by their IDs.
@@ -538,7 +533,8 @@ bool BookmarkModelAssociator::LoadAssociations() {
id_index.AddAll(bookmark_model_->mobile_node());
std::stack<int64> dfs_stack;
- dfs_stack.push(mobile_bookmarks_id);
+ if (mobile_bookmarks_id != -1)
+ dfs_stack.push(mobile_bookmarks_id);
dfs_stack.push(other_bookmarks_id);
dfs_stack.push(bookmark_bar_id);
« 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