From 9ed6e4e4c03724e91ee95b27c397c41e8f27b7e9 Mon Sep 17 00:00:00 2001 From: AlexeyBarabash Date: Fri, 7 Feb 2020 22:20:56 +0200 Subject: [PATCH] Convert some CHECKs to DCHECK for synced_bookmark_tracker and bookmark_remote_updates_handler --- ...okmarks-bookmark_remote_updates_handler.cc.patch | 13 ++++++++++++- ...-sync_bookmarks-synced_bookmark_tracker.cc.patch | 13 +++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 patches/components-sync_bookmarks-synced_bookmark_tracker.cc.patch diff --git a/patches/components-sync_bookmarks-bookmark_remote_updates_handler.cc.patch b/patches/components-sync_bookmarks-bookmark_remote_updates_handler.cc.patch index 6ee3ba22ec8b..cb8db3265b20 100644 --- a/patches/components-sync_bookmarks-bookmark_remote_updates_handler.cc.patch +++ b/patches/components-sync_bookmarks-bookmark_remote_updates_handler.cc.patch @@ -1,5 +1,5 @@ diff --git a/components/sync_bookmarks/bookmark_remote_updates_handler.cc b/components/sync_bookmarks/bookmark_remote_updates_handler.cc -index c31275713056a2a1dd07872bc3569d54a8cfce0e..700877cd135845fe686626e821870ff0bbc3f453 100644 +index c31275713056a2a1dd07872bc3569d54a8cfce0e..8128b7ceb92166d149056c15d9a9f7dc23fb5514 100644 --- a/components/sync_bookmarks/bookmark_remote_updates_handler.cc +++ b/components/sync_bookmarks/bookmark_remote_updates_handler.cc @@ -144,6 +144,7 @@ void ApplyRemoteUpdate( @@ -10,6 +10,17 @@ index c31275713056a2a1dd07872bc3569d54a8cfce0e..700877cd135845fe686626e821870ff0 ComputeChildNodeIndex(new_parent, update_entity.unique_position, tracker); tracker->Update(update_entity.id, update.response_version, update_entity.modification_time, +@@ -241,8 +242,8 @@ void BookmarkRemoteUpdatesHandler::Process( + const bookmarks::BookmarkNode* old_node = old_entity->bookmark_node(); + const bookmarks::BookmarkNode* new_node = + tracked_entity->bookmark_node(); +- CHECK(old_node->type() == bookmarks::BookmarkNode::URL); +- CHECK(new_node->type() == bookmarks::BookmarkNode::URL); ++ // CHECK(old_node->type() == bookmarks::BookmarkNode::URL); ++ // CHECK(new_node->type() == bookmarks::BookmarkNode::URL); + CHECK(old_node->url() == new_node->url()); + bookmark_tracker_->Remove(update_entity.originator_client_item_id); + bookmark_model_->Remove(old_node); @@ -449,9 +450,11 @@ bool BookmarkRemoteUpdatesHandler::ProcessCreate( LogProblematicBookmark(RemoteBookmarkUpdateError::kMissingParentNode); return false; diff --git a/patches/components-sync_bookmarks-synced_bookmark_tracker.cc.patch b/patches/components-sync_bookmarks-synced_bookmark_tracker.cc.patch new file mode 100644 index 000000000000..2edaa4d846d7 --- /dev/null +++ b/patches/components-sync_bookmarks-synced_bookmark_tracker.cc.patch @@ -0,0 +1,13 @@ +diff --git a/components/sync_bookmarks/synced_bookmark_tracker.cc b/components/sync_bookmarks/synced_bookmark_tracker.cc +index 5acee2729ad296a9c4a7cbafc2b4bbede0141bc5..324cc5ea8d4470feefa44288d1984dfc9722f1ba 100644 +--- a/components/sync_bookmarks/synced_bookmark_tracker.cc ++++ b/components/sync_bookmarks/synced_bookmark_tracker.cc +@@ -497,7 +497,7 @@ void SyncedBookmarkTracker::UpdateSyncForLocalCreationIfNeeded( + // TODO(crbug.com/516866): The below CHECK is added to debug some crashes. + // Should be removed after figuring out the reason for the crash. + CHECK_EQ(1U, sync_id_to_entities_map_.count(old_id)); +- CHECK_EQ(0U, sync_id_to_entities_map_.count(new_id)); ++ // CHECK_EQ(0U, sync_id_to_entities_map_.count(new_id)); + + std::unique_ptr entity = + std::move(sync_id_to_entities_map_.at(old_id));