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

Unified Diff: remoting/host/desktop_session_win.cc

Issue 17261013: Change the daemon start type to 'manual' if the host ID has been deleted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/desktop_session_win.cc
diff --git a/remoting/host/desktop_session_win.cc b/remoting/host/desktop_session_win.cc
index 23d42b862e31fd3d23ed214510b9a0bd4e54fdb0..f4a56ef9d337b17d67195ee6fe341d5565ea43f3 100644
--- a/remoting/host/desktop_session_win.cc
+++ b/remoting/host/desktop_session_win.cc
@@ -273,7 +273,7 @@ void RdpSession::OnRdpConnected(const net::IPEndPoint& client_endpoint) {
void RdpSession::OnRdpClosed() {
DCHECK(caller_task_runner()->BelongsToCurrentThread());
- OnPermanentError();
+ TerminateSession();
}
void RdpSession::SetScreenResolution(const ScreenResolution& resolution) {
@@ -425,7 +425,7 @@ void DesktopSessionWin::OnSessionAttachTimeout() {
LOG(ERROR) << "Session attach notification didn't arrived within "
<< kSessionAttachTimeoutSeconds << " seconds.";
- OnPermanentError();
+ TerminateSession();
}
void DesktopSessionWin::StartMonitoring(
@@ -458,6 +458,15 @@ void DesktopSessionWin::StopMonitoring() {
OnSessionDetached();
}
+void DesktopSessionWin::TerminateSession() {
+ DCHECK(caller_task_runner_->BelongsToCurrentThread());
+
+ StopMonitoring();
+
+ // This call will delete |this| so it should be at the very end of the method.
+ daemon_process()->CloseDesktopSession(id());
+}
+
void DesktopSessionWin::OnChannelConnected(int32 peer_pid) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
@@ -495,13 +504,10 @@ bool DesktopSessionWin::OnMessageReceived(const IPC::Message& message) {
return handled;
}
-void DesktopSessionWin::OnPermanentError() {
+void DesktopSessionWin::OnPermanentError(int exit_code) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
- StopMonitoring();
-
- // This call will delete |this| so it should be at the very end of the method.
- daemon_process()->CloseDesktopSession(id());
+ TerminateSession();
}
void DesktopSessionWin::OnSessionAttached(uint32 session_id) {
@@ -525,7 +531,7 @@ void DesktopSessionWin::OnSessionAttached(uint32 session_id) {
}
if (!result) {
- OnPermanentError();
+ TerminateSession();
return;
}
@@ -545,7 +551,7 @@ void DesktopSessionWin::OnSessionAttached(uint32 session_id) {
launch_elevated,
WideToUTF8(kDaemonIpcSecurityDescriptor)));
if (!delegate->Initialize(session_id)) {
- OnPermanentError();
+ TerminateSession();
return;
}

Powered by Google App Engine
This is Rietveld 408576698