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

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

Issue 10152003: sync: Make BaseNode lookup-related Init functions return specific failures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/sync/glue/bookmark_model_associator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/bookmark_change_processor.cc
diff --git a/chrome/browser/sync/glue/bookmark_change_processor.cc b/chrome/browser/sync/glue/bookmark_change_processor.cc
index bc0cd154e1ae167977d2d2c44790a569f977d87b..ebf6c8de313c04ec9846d8246be11a81570fc776 100644
--- a/chrome/browser/sync/glue/bookmark_change_processor.cc
+++ b/chrome/browser/sync/glue/bookmark_change_processor.cc
@@ -459,7 +459,7 @@ void BookmarkChangeProcessor::ApplyChangesFromSyncModel(
passed_deletes = true;
sync_api::ReadNode src(trans);
- if (!src.InitByIdLookup(it->id)) {
+ if (src.InitByIdLookup(it->id) != sync_api::BaseNode::INIT_OK) {
error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE,
"ApplyModelChanges was passed a bad ID");
return;
@@ -474,7 +474,8 @@ void BookmarkChangeProcessor::ApplyChangesFromSyncModel(
// fail). Therefore, we add special logic here just to detect the
// Synced Bookmarks folder.
sync_api::ReadNode synced_bookmarks(trans);
- if (synced_bookmarks.InitByTagLookup(kMobileBookmarksTag) &&
+ if (synced_bookmarks.InitByTagLookup(kMobileBookmarksTag) ==
+ sync_api::BaseNode::INIT_OK &&
synced_bookmarks.GetId() == it->id) {
// This is a newly created Synced Bookmarks node. Associate it.
model_associator_->Associate(model->mobile_node(), it->id);
« no previous file with comments | « no previous file | chrome/browser/sync/glue/bookmark_model_associator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698