[omnibox] Fix logging of async match changes in AutocompleteController
The previous way we counted async match changes in AutocompleteController was wrong, because I misunderstood how AutocompleteResult::CopyOldMatches works. Previously, CopyOldMatches would actually *move* the matches from the old result to the new result. This operation cleared out |last_result|. Since we determine if a match position has changed by comparing |last_result| to the new |result_|, this overinflated the number of changed matches. I've verified this by adding detailed logging on my test machine. This CL makes CopyOldMatches take a const parameter, and copy over the old matches without mutating |last_result|. I think there's no way for us to do this type of logging while still doing the destructive-move from |last_result|, and I suspect doing a copy instead of a move will have a negligible performance impact, and no memory impact. Bug: 398135 Change-Id: I0e1c5f58c6264b5be4c3d12366ae6e3c66f2a04f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899314Reviewed-by:Mark Pearson <mpearson@chromium.org> Reviewed-by:
Justin Donnelly <jdonnelly@chromium.org> Reviewed-by:
Kevin Bailey <krb@chromium.org> Commit-Queue: Tommy Li <tommycli@chromium.org> Cr-Commit-Position: refs/heads/master@{#714011}
Showing
Please register or sign in to comment