• Fabian Henneke's avatar
    Manage Autofill session lifetime · d61502a8
    Fabian Henneke authored
    During an Autofill session, distinct sets of views (also called
    partitions) can trigger individual fill requests. However, there is a
    configurable limit on the maximum number of partitions, which in the
    case of stock Android is set to 10. Since Chrome never finishes an
    Autofill session and every page load with a form adds a partition, this
    means that Autofill fills stop triggering after a short time.
    
    This can be mitigated by cancelling the session when user actions
    indicate that there is no longer any Autofill-related state to preserve
    in the current tab:
    * When the user switches away from a tab. By cancelling the session
      before the tab contents become hidden, we additionally prevent
      Autofill from initiating a save flow as all virtual views become
      invisible.
    * When top-level navigation occurs that has not been initiated by the
      renderer. Renderer-initiated navigation, such as tapping a submit
      button in a form, may trigger Autofill's save functionality and must
      therefore not cancel the session.
    * When the domain part of the current URL changes. This behavior is part
      of the Android Autofill service's compatibility mode, but was
      partially broken on Android Q+ due to http://crbug.com/1103555 and
      completely broken by the workaround for that bug. The current change
      restored this behavior.
    
    These changes apply to Android P+ only as this is the first Android
    version with compatibility Autofill support for Chrome.
    
    The remaining scenarios in which the maximal partition count can be
    reached and Autofill stops triggering include:
    * A single document with more than ten separate forms. This should be
      rare and would equally be a problem in a native app.
    * Single-page apps or those consisting of multiple linked pages with a
      high total number of fillable forms. If the user does not switch tabs,
      Autofill may stop working after some time. Further improvements might
      be possible here, but have to avoid cancelling Autofill in a possible
      save scenario.
    
    Bug: 1150732
    Change-Id: I1005cbd349f3ba3ea25a9edafe80d82a21876bce
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546900Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
    Reviewed-by: default avatarMichael Bai <michaelbai@chromium.org>
    Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
    Commit-Queue: Fabian Henneke <fabian.henneke@gmail.com>
    Cr-Commit-Position: refs/heads/master@{#831987}
    d61502a8
chrome_java_sources.gni 129 KB