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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/location.h" | 12 #include "base/location.h" |
13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
14 #include "net/base/net_util.h" | 14 #include "net/base/net_util.h" |
15 #include "remoting/base/auto_thread_task_runner.h" | 15 #include "remoting/base/auto_thread_task_runner.h" |
16 #include "remoting/host/branding.h" | 16 #include "remoting/host/branding.h" |
17 #include "remoting/host/chromoting_messages.h" | 17 #include "remoting/host/chromoting_messages.h" |
18 #include "remoting/host/desktop_session.h" | 18 #include "remoting/host/desktop_session.h" |
19 #include "remoting/host/host_event_logger.h" | 19 #include "remoting/host/host_event_logger.h" |
20 #include "remoting/host/host_exit_codes.h" | |
20 #include "remoting/host/host_status_observer.h" | 21 #include "remoting/host/host_status_observer.h" |
21 #include "remoting/host/screen_resolution.h" | 22 #include "remoting/host/screen_resolution.h" |
22 #include "remoting/protocol/transport.h" | 23 #include "remoting/protocol/transport.h" |
23 | 24 |
24 namespace remoting { | 25 namespace remoting { |
25 | 26 |
26 namespace { | 27 namespace { |
27 | 28 |
28 // This is used for tagging system event logs. | 29 // This is used for tagging system event logs. |
29 const char kApplicationName[] = "chromoting"; | 30 const char kApplicationName[] = "chromoting"; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 IPC_END_MESSAGE_MAP() | 120 IPC_END_MESSAGE_MAP() |
120 | 121 |
121 if (!handled) { | 122 if (!handled) { |
122 LOG(ERROR) << "Received unexpected IPC type: " << message.type(); | 123 LOG(ERROR) << "Received unexpected IPC type: " << message.type(); |
123 CrashNetworkProcess(FROM_HERE); | 124 CrashNetworkProcess(FROM_HERE); |
124 } | 125 } |
125 | 126 |
126 return handled; | 127 return handled; |
127 } | 128 } |
128 | 129 |
129 void DaemonProcess::OnPermanentError() { | 130 void DaemonProcess::OnPermanentError(int exit_code) { |
130 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 131 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
132 | |
Jamie
2013/06/20 17:37:54
Nit: I don't think a blank line here improves read
alexeypa (please no reviews)
2013/06/20 21:19:12
Done.
| |
131 Stop(); | 133 Stop(); |
132 } | 134 } |
133 | 135 |
134 void DaemonProcess::CloseDesktopSession(int terminal_id) { | 136 void DaemonProcess::CloseDesktopSession(int terminal_id) { |
135 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 137 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
136 | 138 |
137 // Validate the supplied terminal ID. An attempt to use a desktop session ID | 139 // Validate the supplied terminal ID. An attempt to use a desktop session ID |
138 // that couldn't possibly have been allocated is considered a protocol error | 140 // that couldn't possibly have been allocated is considered a protocol error |
139 // and the network process will be restarted. | 141 // and the network process will be restarted. |
140 if (!WasTerminalIdAllocated(terminal_id)) { | 142 if (!WasTerminalIdAllocated(terminal_id)) { |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
368 } | 370 } |
369 | 371 |
370 void DaemonProcess::DeleteAllDesktopSessions() { | 372 void DaemonProcess::DeleteAllDesktopSessions() { |
371 while (!desktop_sessions_.empty()) { | 373 while (!desktop_sessions_.empty()) { |
372 delete desktop_sessions_.front(); | 374 delete desktop_sessions_.front(); |
373 desktop_sessions_.pop_front(); | 375 desktop_sessions_.pop_front(); |
374 } | 376 } |
375 } | 377 } |
376 | 378 |
377 } // namespace remoting | 379 } // namespace remoting |
OLD | NEW |