• Tommy Li's avatar
    [omnibox] Fix logging of async match changes in AutocompleteController · af487bd0
    Tommy Li authored
    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: default avatarMark Pearson <mpearson@chromium.org>
    Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
    Reviewed-by: default avatarKevin Bailey <krb@chromium.org>
    Commit-Queue: Tommy Li <tommycli@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#714011}
    af487bd0
histograms.xml 6.59 MB
The source could not be displayed because it is larger than 1 MB. You can load it anyway or download it instead.