• Stephane Zermatten's avatar
    [Autofill Assistant] Avoid race conditions in graceful shutdown. · a42a7895
    Stephane Zermatten authored
    Before this patch, there were cases where the controller would enter
    graceful shutdown because of a script, with a successful message, and
    then notice an error, and change that message to an error. The error was
    usually caused by DidStartNavigation noticing an unexpected navigation
    event, triggered by an action run at the end of the last script.
    
    This patch attempts to avoid such case by:
     - only checking for unexpected navigation events in the PROMPT state.
     This specifically excludes the STOPPED and RUNNING states.
     - not reporting errors or accepting script updates (OnGetScript) in the
     STOPPED state
     - stopping script checks when entering the fatal error state
    
    Bug: 806868
    Change-Id: I408d2652257d9524740e44c79b7fa5201ef7cc17
    Reviewed-on: https://chromium-review.googlesource.com/c/1436047
    Commit-Queue: Stephane Zermatten <szermatt@chromium.org>
    Reviewed-by: default avatarMathias Carlen <mcarlen@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#626937}
    a42a7895
controller.cc 21.4 KB