| Index: remoting/host/daemon_process.cc
|
| diff --git a/remoting/host/daemon_process.cc b/remoting/host/daemon_process.cc
|
| index 2e693342d880b6be2253664fa7d24ff8ae9bb31e..54236f9e27bdc4c6be2a76e5511ca55b8a08529e 100644
|
| --- a/remoting/host/daemon_process.cc
|
| +++ b/remoting/host/daemon_process.cc
|
| @@ -78,7 +78,7 @@ void DaemonProcess::CloseDesktopSession(int terminal_id) {
|
| // a protocol error and the network process will be restarted.
|
| if (!IsTerminalIdKnown(terminal_id)) {
|
| LOG(ERROR) << "An invalid terminal ID. terminal_id=" << terminal_id;
|
| - RestartNetworkProcess();
|
| + CrashNetworkProcess(FROM_HERE);
|
| DeleteAllDesktopSessions();
|
| return;
|
| }
|
| @@ -115,27 +115,6 @@ DaemonProcess::DaemonProcess(
|
| DCHECK(caller_task_runner->BelongsToCurrentThread());
|
| }
|
|
|
| -void DaemonProcess::Initialize() {
|
| - DCHECK(caller_task_runner()->BelongsToCurrentThread());
|
| -
|
| - // Get the name of the host configuration file.
|
| - FilePath default_config_dir = remoting::GetConfigDir();
|
| - FilePath config_path = default_config_dir.Append(kDefaultHostConfigFile);
|
| - const CommandLine* command_line = CommandLine::ForCurrentProcess();
|
| - if (command_line->HasSwitch(kHostConfigSwitchName)) {
|
| - config_path = command_line->GetSwitchValuePath(kHostConfigSwitchName);
|
| - }
|
| -
|
| - // Start watching the host configuration file.
|
| - config_watcher_.reset(new ConfigFileWatcher(caller_task_runner(),
|
| - io_task_runner(),
|
| - this));
|
| - config_watcher_->Watch(config_path);
|
| -
|
| - // Launch the process.
|
| - LaunchNetworkProcess();
|
| -}
|
| -
|
| bool DaemonProcess::IsTerminalIdKnown(int terminal_id) {
|
| return terminal_id < next_terminal_id_;
|
| }
|
| @@ -148,7 +127,7 @@ void DaemonProcess::CreateDesktopSession(int terminal_id) {
|
| // a protocol error and the network process will be restarted.
|
| if (IsTerminalIdKnown(terminal_id)) {
|
| LOG(ERROR) << "An invalid terminal ID. terminal_id=" << terminal_id;
|
| - RestartNetworkProcess();
|
| + CrashNetworkProcess(FROM_HERE);
|
| DeleteAllDesktopSessions();
|
| return;
|
| }
|
| @@ -159,6 +138,33 @@ void DaemonProcess::CreateDesktopSession(int terminal_id) {
|
| next_terminal_id_ = std::max(next_terminal_id_, terminal_id + 1);
|
| }
|
|
|
| +void DaemonProcess::CrashNetworkProcess(
|
| + const tracked_objects::Location& location) {
|
| + SendToNetwork(new ChromotingDaemonNetworkMsg_Crash(
|
| + location.function_name(), location.file_name(), location.line_number()));
|
| +}
|
| +
|
| +void DaemonProcess::Initialize() {
|
| + DCHECK(caller_task_runner()->BelongsToCurrentThread());
|
| +
|
| + // Get the name of the host configuration file.
|
| + FilePath default_config_dir = remoting::GetConfigDir();
|
| + FilePath config_path = default_config_dir.Append(kDefaultHostConfigFile);
|
| + const CommandLine* command_line = CommandLine::ForCurrentProcess();
|
| + if (command_line->HasSwitch(kHostConfigSwitchName)) {
|
| + config_path = command_line->GetSwitchValuePath(kHostConfigSwitchName);
|
| + }
|
| +
|
| + // Start watching the host configuration file.
|
| + config_watcher_.reset(new ConfigFileWatcher(caller_task_runner(),
|
| + io_task_runner(),
|
| + this));
|
| + config_watcher_->Watch(config_path);
|
| +
|
| + // Launch the process.
|
| + LaunchNetworkProcess();
|
| +}
|
| +
|
| void DaemonProcess::DoStop() {
|
| DCHECK(caller_task_runner()->BelongsToCurrentThread());
|
|
|
|
|