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 unrecoverable_error_handler_->OnSingleDatatypeUnrecoverableError( | 733 syncer::SyncError error( |
734 FROM_HERE, | 734 FROM_HERE, |
735 "Could not lookup bookmark node for ID persistence."); | 735 syncer::SyncError::DATATYPE_ERROR, |
| 736 "Could not lookup bookmark node for ID persistence.", |
| 737 syncer::BOOKMARKS); |
| 738 unrecoverable_error_handler_->OnSingleDataTypeUnrecoverableError(error); |
736 return; | 739 return; |
737 } | 740 } |
738 const BookmarkNode* node = GetChromeNodeFromSyncId(sync_id); | 741 const BookmarkNode* node = GetChromeNodeFromSyncId(sync_id); |
739 if (node && sync_node.GetExternalId() != node->id()) { | 742 if (node && sync_node.GetExternalId() != node->id()) { |
740 sync_node.SetExternalId(node->id()); | 743 sync_node.SetExternalId(node->id()); |
741 bnodes.push_back(node); | 744 bnodes.push_back(node); |
742 } | 745 } |
743 } | 746 } |
744 dirty_associations_sync_ids_.clear(); | 747 dirty_associations_sync_ids_.clear(); |
745 } | 748 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 syncer::SyncError::PERSISTENCE_ERROR, | 794 syncer::SyncError::PERSISTENCE_ERROR, |
792 message, | 795 message, |
793 syncer::BOOKMARKS); | 796 syncer::BOOKMARKS); |
794 } | 797 } |
795 } | 798 } |
796 } | 799 } |
797 return syncer::SyncError(); | 800 return syncer::SyncError(); |
798 } | 801 } |
799 | 802 |
800 } // namespace browser_sync | 803 } // namespace browser_sync |
OLD | NEW |