Added exit early in Button::SetTooltipText when the tooltip text doesn't change.
Currently, Button::SetTooltipText will always call OnTooltipTextChanged even if the new tooltip text is the same as the old one. With this change, it exits early if the new tooltip text doesn't change. This reduces the time spent inside LocationBarView::RefreshContentSettingViews from ~1 - 2.5 ms to ~0.02 - 0.06 ms since it will eventually call Button::SetTooltipText multiple times for eachContentSettingImageView. Bug: 933546 Change-Id: I2051a9eef19faa04898956fc172ac7bc6bc7ca9f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1515641Reviewed-by:Sadrul Chowdhury <sadrul@chromium.org> Commit-Queue: Edwin Joe <ejoe@google.com> Cr-Commit-Position: refs/heads/master@{#645312}
Showing
Please register or sign in to comment