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 "components/sync_bookmarks/bookmark_model_associator.h" | 5 #include "components/sync_bookmarks/bookmark_model_associator.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
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 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 int bookmark_index, | 748 int bookmark_index, |
749 const syncer::BaseNode* sync_child_node, | 749 const syncer::BaseNode* sync_child_node, |
750 const GURL& url, | 750 const GURL& url, |
751 Context* context, | 751 Context* context, |
752 syncer::SyncError* error) { | 752 syncer::SyncError* error) { |
753 DCHECK_LE(bookmark_index, parent_node->child_count()); | 753 DCHECK_LE(bookmark_index, parent_node->child_count()); |
754 | 754 |
755 const std::string& sync_title = sync_child_node->GetTitle(); | 755 const std::string& sync_title = sync_child_node->GetTitle(); |
756 | 756 |
757 if (!sync_child_node->GetIsFolder() && !url.is_valid()) { | 757 if (!sync_child_node->GetIsFolder() && !url.is_valid()) { |
758 unrecoverable_error_handler_->CreateAndUploadError( | 758 LOG(WARNING) << "Cannot associate sync node " |
759 FROM_HERE, | 759 << sync_child_node->GetSyncId().value() << " with invalid url " |
760 "Cannot associate sync node " + sync_child_node->GetSyncId().value() + | 760 << url.possibly_invalid_spec() << " and title " << sync_title; |
761 " with invalid url " + url.possibly_invalid_spec() + " and title " + | 761 // Don't propagate an error to the model_type in this case. |
762 sync_title, | |
763 model_type()); | |
764 // Don't propagate the error to the model_type in this case. | |
765 return nullptr; | 762 return nullptr; |
766 } | 763 } |
767 | 764 |
768 base::string16 bookmark_title = base::UTF8ToUTF16(sync_title); | 765 base::string16 bookmark_title = base::UTF8ToUTF16(sync_title); |
769 const BookmarkNode* child_node = BookmarkChangeProcessor::CreateBookmarkNode( | 766 const BookmarkNode* child_node = BookmarkChangeProcessor::CreateBookmarkNode( |
770 bookmark_title, url, sync_child_node, parent_node, bookmark_model_, | 767 bookmark_title, url, sync_child_node, parent_node, bookmark_model_, |
771 sync_client_, bookmark_index); | 768 sync_client_, bookmark_index); |
772 if (!child_node) { | 769 if (!child_node) { |
773 *error = unrecoverable_error_handler_->CreateAndUploadError( | 770 *error = unrecoverable_error_handler_->CreateAndUploadError( |
774 FROM_HERE, "Failed to create bookmark node with title " + sync_title + | 771 FROM_HERE, "Failed to create bookmark node with title " + sync_title + |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 syncer::BOOKMARKS); | 1004 syncer::BOOKMARKS); |
1008 } else { | 1005 } else { |
1009 context->set_native_model_sync_state(BEHIND); | 1006 context->set_native_model_sync_state(BEHIND); |
1010 } | 1007 } |
1011 } | 1008 } |
1012 } | 1009 } |
1013 return syncer::SyncError(); | 1010 return syncer::SyncError(); |
1014 } | 1011 } |
1015 | 1012 |
1016 } // namespace sync_bookmarks | 1013 } // namespace sync_bookmarks |
OLD | NEW |