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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 new ChromotingDaemonNetworkMsg_TerminalDisconnected(terminal_id)); | 212 new ChromotingDaemonNetworkMsg_TerminalDisconnected(terminal_id)); |
212 return; | 213 return; |
213 } | 214 } |
214 | 215 |
215 // Update the expected terminal ID. | 216 // Update the expected terminal ID. |
216 next_terminal_id_ = std::max(next_terminal_id_, terminal_id + 1); | 217 next_terminal_id_ = std::max(next_terminal_id_, terminal_id + 1); |
217 } | 218 } |
218 | 219 |
219 void DaemonProcess::CrashNetworkProcess( | 220 void DaemonProcess::CrashNetworkProcess( |
220 const tracked_objects::Location& location) { | 221 const tracked_objects::Location& location) { |
221 SendToNetwork(new ChromotingDaemonNetworkMsg_Crash( | 222 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
222 location.function_name(), location.file_name(), location.line_number())); | |
223 | 223 |
| 224 DoCrashNetworkProcess(location); |
224 DeleteAllDesktopSessions(); | 225 DeleteAllDesktopSessions(); |
225 } | 226 } |
226 | 227 |
227 void DaemonProcess::Initialize() { | 228 void DaemonProcess::Initialize() { |
228 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 229 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
229 | 230 |
230 // Get the name of the host configuration file. | 231 // Get the name of the host configuration file. |
231 base::FilePath default_config_dir = remoting::GetConfigDir(); | 232 base::FilePath default_config_dir = remoting::GetConfigDir(); |
232 base::FilePath config_path = default_config_dir.Append(kDefaultHostConfigFile)
; | 233 base::FilePath config_path = default_config_dir.Append(kDefaultHostConfigFile)
; |
233 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 234 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 } | 344 } |
344 | 345 |
345 void DaemonProcess::DeleteAllDesktopSessions() { | 346 void DaemonProcess::DeleteAllDesktopSessions() { |
346 while (!desktop_sessions_.empty()) { | 347 while (!desktop_sessions_.empty()) { |
347 delete desktop_sessions_.front(); | 348 delete desktop_sessions_.front(); |
348 desktop_sessions_.pop_front(); | 349 desktop_sessions_.pop_front(); |
349 } | 350 } |
350 } | 351 } |
351 | 352 |
352 } // namespace remoting | 353 } // namespace remoting |
OLD | NEW |