Commit b810f7ac authored by Mikel Astiz's avatar Mikel Astiz Committed by Commit Bot

Rename BookmarkModel::RemoveNode()

As the comment describes, the function does not delete the node itself
and the main purpose of the function is to remove references from the
index.

This also makes the name consistent with the insertion counterpart,
BookmarkModel::AddNodeToIndexRecursive().

Bug: None
Change-Id: I515eba1efcc956f343b31a7a2457678aadc4e091
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899376Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713039}
parent 713f563c
......@@ -212,7 +212,7 @@ void BookmarkModel::Remove(const BookmarkNode* node) {
std::set<GURL> removed_urls;
std::unique_ptr<BookmarkNode> owned_node =
url_index_->Remove(AsMutable(node), &removed_urls);
RemoveNode(owned_node.get());
RemoveNodeFromIndexRecursive(owned_node.get());
if (store_)
store_->ScheduleSave();
......@@ -248,7 +248,7 @@ void BookmarkModel::RemoveAllUserBookmarks() {
for (size_t j = permanent_node->children().size(); j > 0; --j) {
std::unique_ptr<BookmarkNode> node = url_index_->Remove(
permanent_node->children()[j - 1].get(), &removed_urls);
RemoveNode(node.get());
RemoveNodeFromIndexRecursive(node.get());
removed_node_data_list.push_back(
{permanent_node.get(), j - 1, std::move(node)});
}
......@@ -753,7 +753,7 @@ void BookmarkModel::NotifyNodeAddedForAllDescendents(const BookmarkNode* node) {
}
}
void BookmarkModel::RemoveNode(BookmarkNode* node) {
void BookmarkModel::RemoveNodeFromIndexRecursive(BookmarkNode* node) {
DCHECK(loaded_);
DCHECK(!is_permanent_node(node));
......@@ -764,7 +764,7 @@ void BookmarkModel::RemoveNode(BookmarkNode* node) {
// Recurse through children.
for (size_t i = node->children().size(); i > 0; --i)
RemoveNode(node->children()[i - 1].get());
RemoveNodeFromIndexRecursive(node->children()[i - 1].get());
}
void BookmarkModel::DoneLoading(std::unique_ptr<BookmarkLoadDetails> details) {
......
......@@ -323,7 +323,7 @@ class BookmarkModel : public BookmarkUndoProvider,
// the node is a url, its url is added to removed_urls.
//
// This does NOT delete the node.
void RemoveNode(BookmarkNode* node);
void RemoveNodeFromIndexRecursive(BookmarkNode* node);
// Called when done loading. Updates internal state and notifies observers.
void DoneLoading(std::unique_ptr<BookmarkLoadDetails> details);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment