Index: remoting/host/remoting_me2me_host.cc |
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc |
index f2aa98331acea8f1f8076cf4540bed9a2c5220c0..d2149fd5cd49b71efc550915437cbd792e028c17 100644 |
--- a/remoting/host/remoting_me2me_host.cc |
+++ b/remoting/host/remoting_me2me_host.cc |
@@ -61,6 +61,7 @@ |
#include "remoting/host/pairing_registry_delegate.h" |
#include "remoting/host/policy_hack/policy_watcher.h" |
#include "remoting/host/session_manager_factory.h" |
+#include "remoting/host/shutdown_watchdog.h" |
#include "remoting/host/signaling_connector.h" |
#include "remoting/host/single_window_desktop_environment.h" |
#include "remoting/host/token_validator_factory_impl.h" |
@@ -316,6 +317,9 @@ class HostProcess |
// capturing a window instead of the entire desktop. |
bool enable_window_capture_; |
+ // Destroying the watchdog will disarm it, so it should be destroyed last. |
Jamie
2014/12/10 03:02:23
It should be the first member variable in that cas
Łukasz Anforowicz
2014/12/10 17:15:31
It is possible that HostProcess is destroyed, but
|
+ ShutdownWatchdog shutdown_watchdog_; |
+ |
// Used to specify which window to stream, if enabled. |
webrtc::WindowId window_id_; |
@@ -358,6 +362,7 @@ HostProcess::HostProcess(scoped_ptr<ChromotingHostContext> context, |
curtain_required_(false), |
enable_gnubby_auth_(false), |
enable_window_capture_(false), |
+ shutdown_watchdog_(base::TimeDelta::FromSeconds(15)), |
Łukasz Anforowicz
2014/12/10 17:15:31
Looks good. I wonder if we should pull all the pr
|
window_id_(0), |
#if defined(REMOTING_MULTI_PROCESS) |
desktop_session_connector_(NULL), |
@@ -1416,6 +1421,9 @@ void HostProcess::ShutdownOnNetworkThread() { |
} else if (state_ == HOST_STOPPING) { |
state_ = HOST_STOPPED; |
+ shutdown_watchdog_.SetExitCode(*exit_code_out_); |
+ shutdown_watchdog_.Arm(); |
+ |
if (policy_watcher_.get()) { |
policy_watcher_->StopWatching( |
base::Bind(&HostProcess::OnPolicyWatcherShutdown, this)); |