• Tomasz Wiszkowski's avatar
    Associate the native- and java AutocompleteMatch objects. · 0ace523b
    Tomasz Wiszkowski authored
    This change enables the native AutocompleteMatch object to create and
    retain a copy of its corresponding java counterpart.
    
    The change essentially shifts code around, moving logic away from
    AutocompleteController into AutocompleteMatch (both Java and Native).
    
    The change optimizes slightly creation of the Java counterparts by
    retaining an object if it's already created. This comes in handy for
    every match that is backfilled on every keystroke (about 3 times every
    time we call AutocompleteController::Start() to get new matches).
    
    Java AutocompleteMatch objects are lazily constructed to reduce
    penalty when native objects end up thrown away -- see:
    * AutcompleteController#classify(),
    * AutocompleteController#qualifyPartialUrlQuery()
    
    Bug: 1138587
    Change-Id: I8c5437cfb0203d5c7f5e1d79747eee3f15b7b0b2
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2538499
    Commit-Queue: Tomasz Wiszkowski <ender@google.com>
    Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
    Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#828488}
    0ace523b
autocomplete_match.h 33.9 KB