commit | b9980c07de6c768db7357062034ced92c443ed3b | [log] [tgz] |
---|---|---|
author | Mikel Astiz <[email protected]> | Fri Jan 31 17:11:31 2020 |
committer | Commit Bot <[email protected]> | Fri Jan 31 17:11:31 2020 |
tree | 07c24ccee0daa78636edf0f42f09336919bb8cbc | |
parent | bd711be6feb1322acb1800c1d211118ddcac6b5c [diff] [blame] |
bookmarks: Fix theoretical race when changing titles A BookmarkNode's title can only be changed from the UI thread, but is also read by the history backend thread via HistoryBookmarkModel::GetBookmarks(). Hence, a lock must be acquired before changing the title. In practice, this race should be extremely unlikely (if not impossible) since assignment of base::string16 may as well be atomic in practice. Change-Id: I8b31b977efe8fdcb918be8692984b2eab9dd0411 Bug: None Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2031041 Reviewed-by: Scott Violet <[email protected]> Commit-Queue: Mikel Astiz <[email protected]> Cr-Commit-Position: refs/heads/master@{#737357}
diff --git a/components/bookmarks/browser/bookmark_model.cc b/components/bookmarks/browser/bookmark_model.cc index 267563c..ad0c6f9 100644 --- a/components/bookmarks/browser/bookmark_model.cc +++ b/components/bookmarks/browser/bookmark_model.cc
@@ -388,7 +388,7 @@ // title changed but should be excluded from the index. if (node->is_url()) titled_url_index_->Remove(node); - AsMutable(node)->SetTitle(title); + url_index_->SetTitle(AsMutable(node), title); if (node->is_url()) titled_url_index_->Add(node);