Index: remoting/host/daemon_process.cc |
diff --git a/remoting/host/daemon_process.cc b/remoting/host/daemon_process.cc |
index c3c7fd9ba92909ab2cae311778e20f5a48b4e7fe..36ddd0f7620d9d857e01476d3106783bb603d90b 100644 |
--- a/remoting/host/daemon_process.cc |
+++ b/remoting/host/daemon_process.cc |
@@ -132,6 +132,9 @@ bool DaemonProcess::OnMessageReceived(const IPC::Message& message) { |
void DaemonProcess::OnPermanentError(int exit_code) { |
DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
+ DCHECK(kMinPermanentErrorExitCode <= exit_code && |
+ exit_code <= kMaxPermanentErrorExitCode); |
+ |
Stop(); |
} |
@@ -363,10 +366,16 @@ void DaemonProcess::OnHostStarted(const std::string& xmpp_login) { |
FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, OnStart(xmpp_login)); |
} |
-void DaemonProcess::OnHostShutdown() { |
+void DaemonProcess::OnHostShutdown(int exit_code) { |
Sergey Ulanov
2015/04/07 21:50:18
It looks like ChromotingNetworkDaemonMsg_HostShutd
|
DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
- FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, OnShutdown()); |
+ if (kMinPermanentErrorExitCode <= exit_code && |
+ exit_code <= kMaxPermanentErrorExitCode) { |
+ OnPermanentError(exit_code); |
+ return; |
+ } |
+ FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, |
+ OnShutdown((HostExitCodes)exit_code)); |
} |
void DaemonProcess::DeleteAllDesktopSessions() { |