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

Unified Diff: remoting/host/daemon_process.cc

Issue 1061903002: Disable chromoting service on permanent errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months 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
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() {

Powered by Google App Engine
This is Rietveld 408576698