• Stephane Zermatten's avatar
    [Autofill Assistant] Add support for interrupts. · 6db9ceb0
    Stephane Zermatten authored
    This change introduces support for interrupts.
    
    Interrupts can be run as part of wait_for_dom with
    allow_interrupts=true.
    
    Interrupts can also run manually, by clicking on a chip, but only if
    they have a name.
    
    Interrupts can run automatically if they have autostart=true. Autostart
    interrupts are handled differently from normal autostart, as they can
    happen at any time. Running an autostart interrupt does not prevent
    runnig a normal interrupt.
    
    I tried to keep changes to the main, non-interrupt, path and
    refactorings to a minimum in this change.
    
    The result puts all the complexity into the script executor. I'd like to
    get it to work, then find a good code split in a follow-up change. The
    code has resisted all my attempts at reorganization so far...
    
    Change to the main, non-interrupt path:
    
     - The responsibility for updating the script status is moved to
     ScriptExecutor, even though the script status map stays in
     ScriptTracker.This allows tracking script state changes caused by
     interrupts running.
    
     - The WaitForDom now uses the same wait code as
     ActionDelegate::WaitForElement instead of rolling up its own
    
    Limitations:
    
     - The payload from interrupts is never sent back to the server. This
     doesn't allow interrupts to change variables
    
     - If an interrupt fails, the failure of the main script is not
     reported to the server; from the server's point of view, the main
     script just never finishes.
    
     - There's no "prompt" action yet, so interrupts cannot ask questions.
    
    Bug: 806868
    Change-Id: I12165965783ba479688c4c5b44ab72477ad4ae2b
    Reviewed-on: https://chromium-review.googlesource.com/c/1340309
    Commit-Queue: Stephane Zermatten <szermatt@chromium.org>
    Reviewed-by: default avatarMathias Carlen <mcarlen@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#610382}
    6db9ceb0
service.proto 17.3 KB