• lukasza's avatar
    Suspend (rather than shut down) the host upon policy errors. · fecb18b7
    lukasza authored
    This changelist primarily changes HostProcess::OnPolicyError, so that it
    doesn't anymore shut down the host, but instead restarts the host and prevents
    the host from starting again until a valid policy has been read (the
    "preventing" functionality has already been present in the form of
    StartHostIfReady method for some time now).
    
    This changelist also simplifies HostSignalingManager's functionality related to
    sending host-offline-reason.  Previously HostProcess was destroyed while
    HostSignalingManager was trying to send host-offline-reason.  Things are
    simpler if HostProcess waits until HostSignalingManager sends
    host-offline-reason or times out.  This synchronization is especially helpful
    when restarting the host (to avoid having to deal with an old
    HostSignalingManager from previous SendHostOfflineReason attempt, while we
    construct a new HostSignalingManager when starting a host after a reset).
    
    This changelist also introduces a separate host-offline-reason for policy
    errors (and updates WebApp resources strings to reflect that).  Note that since
    we are not shutting down the host, we probably cannot use one of HostExitCodes
    as the host-offline-reason.
    
    Testing done:
    1. On Linux manually introduce policy errors at startup, verify host doesn't
       start and sends host-offline-reason, fix errors, verify host starts,
       reintroduce errors, verify host suspends and sends host-offline-reason, fix
       errors, verify host starts again.
    2. Verify WebApp UI shows correct tooltip text for the new host-offline-reason.
    
    BUG=455903
    
    Review URL: https://codereview.chromium.org/910403002
    
    Cr-Commit-Position: refs/heads/master@{#317708}
    fecb18b7
host_table_entry.js 16.2 KB