OLD | NEW |
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 <stack> | 7 #include <stack> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 std::vector<const BookmarkNode*> bnodes; | 723 std::vector<const BookmarkNode*> bnodes; |
724 { | 724 { |
725 syncer::WriteTransaction trans(FROM_HERE, user_share_, &new_version); | 725 syncer::WriteTransaction trans(FROM_HERE, user_share_, &new_version); |
726 DirtyAssociationsSyncIds::iterator iter; | 726 DirtyAssociationsSyncIds::iterator iter; |
727 for (iter = dirty_associations_sync_ids_.begin(); | 727 for (iter = dirty_associations_sync_ids_.begin(); |
728 iter != dirty_associations_sync_ids_.end(); | 728 iter != dirty_associations_sync_ids_.end(); |
729 ++iter) { | 729 ++iter) { |
730 int64 sync_id = *iter; | 730 int64 sync_id = *iter; |
731 syncer::WriteNode sync_node(&trans); | 731 syncer::WriteNode sync_node(&trans); |
732 if (sync_node.InitByIdLookup(sync_id) != syncer::BaseNode::INIT_OK) { | 732 if (sync_node.InitByIdLookup(sync_id) != syncer::BaseNode::INIT_OK) { |
733 syncer::SyncError error( | 733 unrecoverable_error_handler_->OnSingleDatatypeUnrecoverableError( |
734 FROM_HERE, | 734 FROM_HERE, |
735 syncer::SyncError::DATATYPE_ERROR, | 735 "Could not lookup bookmark node for ID persistence."); |
736 "Could not lookup bookmark node for ID persistence.", | |
737 syncer::BOOKMARKS); | |
738 unrecoverable_error_handler_->OnSingleDataTypeUnrecoverableError(error); | |
739 return; | 736 return; |
740 } | 737 } |
741 const BookmarkNode* node = GetChromeNodeFromSyncId(sync_id); | 738 const BookmarkNode* node = GetChromeNodeFromSyncId(sync_id); |
742 if (node && sync_node.GetExternalId() != node->id()) { | 739 if (node && sync_node.GetExternalId() != node->id()) { |
743 sync_node.SetExternalId(node->id()); | 740 sync_node.SetExternalId(node->id()); |
744 bnodes.push_back(node); | 741 bnodes.push_back(node); |
745 } | 742 } |
746 } | 743 } |
747 dirty_associations_sync_ids_.clear(); | 744 dirty_associations_sync_ids_.clear(); |
748 } | 745 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 syncer::SyncError::PERSISTENCE_ERROR, | 791 syncer::SyncError::PERSISTENCE_ERROR, |
795 message, | 792 message, |
796 syncer::BOOKMARKS); | 793 syncer::BOOKMARKS); |
797 } | 794 } |
798 } | 795 } |
799 } | 796 } |
800 return syncer::SyncError(); | 797 return syncer::SyncError(); |
801 } | 798 } |
802 | 799 |
803 } // namespace browser_sync | 800 } // namespace browser_sync |
OLD | NEW |