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/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
13 #include "net/base/net_util.h" | 14 #include "net/base/net_util.h" |
14 #include "remoting/base/auto_thread_task_runner.h" | 15 #include "remoting/base/auto_thread_task_runner.h" |
15 #include "remoting/host/branding.h" | 16 #include "remoting/host/branding.h" |
16 #include "remoting/host/chromoting_messages.h" | 17 #include "remoting/host/chromoting_messages.h" |
17 #include "remoting/host/desktop_session.h" | 18 #include "remoting/host/desktop_session.h" |
18 #include "remoting/host/host_event_logger.h" | 19 #include "remoting/host/host_event_logger.h" |
19 #include "remoting/host/host_status_observer.h" | 20 #include "remoting/host/host_status_observer.h" |
20 #include "remoting/protocol/transport.h" | 21 #include "remoting/protocol/transport.h" |
21 | 22 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 171 } |
171 | 172 |
172 VLOG(1) << "Daemon: opened desktop session " << terminal_id; | 173 VLOG(1) << "Daemon: opened desktop session " << terminal_id; |
173 desktop_sessions_.push_back( | 174 desktop_sessions_.push_back( |
174 DoCreateDesktopSession(terminal_id).release()); | 175 DoCreateDesktopSession(terminal_id).release()); |
175 next_terminal_id_ = std::max(next_terminal_id_, terminal_id + 1); | 176 next_terminal_id_ = std::max(next_terminal_id_, terminal_id + 1); |
176 } | 177 } |
177 | 178 |
178 void DaemonProcess::CrashNetworkProcess( | 179 void DaemonProcess::CrashNetworkProcess( |
179 const tracked_objects::Location& location) { | 180 const tracked_objects::Location& location) { |
180 SendToNetwork(new ChromotingDaemonNetworkMsg_Crash( | 181 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
181 location.function_name(), location.file_name(), location.line_number())); | |
182 | 182 |
| 183 DoCrashNetworkProcess(location); |
183 DeleteAllDesktopSessions(); | 184 DeleteAllDesktopSessions(); |
184 } | 185 } |
185 | 186 |
186 void DaemonProcess::Initialize() { | 187 void DaemonProcess::Initialize() { |
187 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 188 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
188 | 189 |
189 // Get the name of the host configuration file. | 190 // Get the name of the host configuration file. |
190 base::FilePath default_config_dir = remoting::GetConfigDir(); | 191 base::FilePath default_config_dir = remoting::GetConfigDir(); |
191 base::FilePath config_path = default_config_dir.Append(kDefaultHostConfigFile)
; | 192 base::FilePath config_path = default_config_dir.Append(kDefaultHostConfigFile)
; |
192 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 193 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 } | 303 } |
303 | 304 |
304 void DaemonProcess::DeleteAllDesktopSessions() { | 305 void DaemonProcess::DeleteAllDesktopSessions() { |
305 while (!desktop_sessions_.empty()) { | 306 while (!desktop_sessions_.empty()) { |
306 delete desktop_sessions_.front(); | 307 delete desktop_sessions_.front(); |
307 desktop_sessions_.pop_front(); | 308 desktop_sessions_.pop_front(); |
308 } | 309 } |
309 } | 310 } |
310 | 311 |
311 } // namespace remoting | 312 } // namespace remoting |
OLD | NEW |