diff options
author | lukasza <lukasza@chromium.org> | 2015-02-23 17:04:12 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-24 01:05:32 +0000 |
commit | fecb18b781906729a0ae22fd82a6dc3fcc929355 (patch) | |
tree | 0d0bba58792e50b6aede12b47fb77c9c99f9dc11 /remoting/host/policy_watcher.cc | |
parent | 1e259c47f603e4b7cc0e9f5e5d4bea56369b3b32 (diff) | |
download | chromium_src-fecb18b781906729a0ae22fd82a6dc3fcc929355.zip chromium_src-fecb18b781906729a0ae22fd82a6dc3fcc929355.tar.gz chromium_src-fecb18b781906729a0ae22fd82a6dc3fcc929355.tar.bz2 |
Suspend (rather than shut down) the host upon policy errors.
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}
Diffstat (limited to 'remoting/host/policy_watcher.cc')
-rw-r--r-- | remoting/host/policy_watcher.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/remoting/host/policy_watcher.cc b/remoting/host/policy_watcher.cc index dfb3b0c..fccb84a 100644 --- a/remoting/host/policy_watcher.cc +++ b/remoting/host/policy_watcher.cc @@ -145,6 +145,7 @@ void PolicyWatcher::UpdatePolicies( } void PolicyWatcher::SignalPolicyError() { + old_policies_->Clear(); policy_error_callback_.Run(); } |