| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/host/daemon_process.h" | 5 #include "remoting/host/daemon_process.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 if (!InitializePairingRegistry()) { | 134 if (!InitializePairingRegistry()) { |
| 135 CrashNetworkProcess(FROM_HERE); | 135 CrashNetworkProcess(FROM_HERE); |
| 136 return; | 136 return; |
| 137 } | 137 } |
| 138 | 138 |
| 139 DaemonProcess::OnChannelConnected(peer_pid); | 139 DaemonProcess::OnChannelConnected(peer_pid); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void DaemonProcessWin::OnPermanentError(int exit_code) { | 142 void DaemonProcessWin::OnPermanentError(int exit_code) { |
| 143 // Change the service start type to 'manual' if the host has been deleted | 143 DCHECK(kMinPermanentErrorExitCode <= exit_code && |
| 144 // remotely. This way the host will not be started every time the machine | 144 exit_code <= kMaxPermanentErrorExitCode); |
| 145 // boots until the user re-enable it again. | 145 |
| 146 if (exit_code == kInvalidHostIdExitCode) | 146 // Both kInvalidHostIdExitCode and kInvalidOauthCredentialsExitCode are |
| 147 // errors then will never go away with the current config. |
| 148 // Disabling automatic service start until the host is re-enabled and config |
| 149 // updated. |
| 150 if (exit_code == kInvalidHostIdExitCode || |
| 151 exit_code == kInvalidOauthCredentialsExitCode) { |
| 147 DisableAutoStart(); | 152 DisableAutoStart(); |
| 153 } |
| 148 | 154 |
| 149 DaemonProcess::OnPermanentError(exit_code); | 155 DaemonProcess::OnPermanentError(exit_code); |
| 150 } | 156 } |
| 151 | 157 |
| 152 void DaemonProcessWin::SendToNetwork(IPC::Message* message) { | 158 void DaemonProcessWin::SendToNetwork(IPC::Message* message) { |
| 153 if (network_launcher_) { | 159 if (network_launcher_) { |
| 154 network_launcher_->Send(message); | 160 network_launcher_->Send(message); |
| 155 } else { | 161 } else { |
| 156 delete message; | 162 delete message; |
| 157 } | 163 } |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 << "\\" << kPairingRegistrySecretsKeyName; | 377 << "\\" << kPairingRegistrySecretsKeyName; |
| 372 return false; | 378 return false; |
| 373 } | 379 } |
| 374 | 380 |
| 375 pairing_registry_privileged_key_.Set(privileged.Take()); | 381 pairing_registry_privileged_key_.Set(privileged.Take()); |
| 376 pairing_registry_unprivileged_key_.Set(unprivileged.Take()); | 382 pairing_registry_unprivileged_key_.Set(unprivileged.Take()); |
| 377 return true; | 383 return true; |
| 378 } | 384 } |
| 379 | 385 |
| 380 } // namespace remoting | 386 } // namespace remoting |
| OLD | NEW |