Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Unified Diff: remoting/host/remoting_me2me_host.cc

Issue 784243003: Ensure the Chromoting Host process eventually terminates when shut down. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/host/shutdown_watchdog.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « no previous file | remoting/host/shutdown_watchdog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698