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

Side by Side Diff: remoting/host/daemon_process_win.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 unified diff | Download patch
OLDNEW
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
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 // Change the service start type to 'manual' if the host has been unregistered
147 // in the remoting host directory. This way the host will not be started every
148 // time the machine boots until the user re-enable it again.
149 // For regular accounts, the exit_code will be kInvalidHostIdExitCode.
150 // For service accounts, the exit_code will be
151 // kInvalidOauthCredentialsExitCode. This is because when a host is deleted
152 // the service account is deleted as well, which revokes the auth token, so
153 // the host is no longer able to authenticate.
Sergey Ulanov 2015/04/07 21:50:18 This description is too wordy. I don't think you n
154 if (exit_code == kInvalidHostIdExitCode ||
155 exit_code == kInvalidOauthCredentialsExitCode) {
147 DisableAutoStart(); 156 DisableAutoStart();
157 }
148 158
149 DaemonProcess::OnPermanentError(exit_code); 159 DaemonProcess::OnPermanentError(exit_code);
150 } 160 }
151 161
152 void DaemonProcessWin::SendToNetwork(IPC::Message* message) { 162 void DaemonProcessWin::SendToNetwork(IPC::Message* message) {
153 if (network_launcher_) { 163 if (network_launcher_) {
154 network_launcher_->Send(message); 164 network_launcher_->Send(message);
155 } else { 165 } else {
156 delete message; 166 delete message;
157 } 167 }
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 << "\\" << kPairingRegistrySecretsKeyName; 381 << "\\" << kPairingRegistrySecretsKeyName;
372 return false; 382 return false;
373 } 383 }
374 384
375 pairing_registry_privileged_key_.Set(privileged.Take()); 385 pairing_registry_privileged_key_.Set(privileged.Take());
376 pairing_registry_unprivileged_key_.Set(unprivileged.Take()); 386 pairing_registry_unprivileged_key_.Set(unprivileged.Take());
377 return true; 387 return true;
378 } 388 }
379 389
380 } // namespace remoting 390 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698