Skip to content

Commit

Permalink
Merge pull request #4554 from brave/check_to_dcheck_on_sync_bkm
Browse files Browse the repository at this point in the history
Convert some CHECKs to DCHECK for synced_bookmark_tracker and bookmar…
  • Loading branch information
darkdh authored Feb 7, 2020
2 parents 9b974a7 + 9ed6e4e commit 0a6249e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -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;
Expand Down
13 changes: 13 additions & 0 deletions patches/components-sync_bookmarks-synced_bookmark_tracker.cc.patch
Original file line number Diff line number Diff line change
@@ -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> entity =
std::move(sync_id_to_entities_map_.at(old_id));

0 comments on commit 0a6249e

Please sign in to comment.