| 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 // This file implements the Windows service controlling Me2Me host processes | 5 // This file implements the Windows service controlling Me2Me host processes |
| 6 // running within user sessions. | 6 // running within user sessions. |
| 7 | 7 |
| 8 #include "remoting/host/desktop_process.h" | 8 #include "remoting/host/desktop_process.h" |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 IPC::PlatformFileForTransit desktop_pipe; | 133 IPC::PlatformFileForTransit desktop_pipe; |
| 134 if (!desktop_agent_->Start(AsWeakPtr(), &desktop_pipe)) { | 134 if (!desktop_agent_->Start(AsWeakPtr(), &desktop_pipe)) { |
| 135 desktop_agent_ = nullptr; | 135 desktop_agent_ = nullptr; |
| 136 caller_task_runner_ = nullptr; | 136 caller_task_runner_ = nullptr; |
| 137 input_task_runner_ = nullptr; | 137 input_task_runner_ = nullptr; |
| 138 desktop_environment_factory_.reset(); | 138 desktop_environment_factory_.reset(); |
| 139 return false; | 139 return false; |
| 140 } | 140 } |
| 141 | 141 |
| 142 // Connect to the daemon. | 142 // Connect to the daemon. |
| 143 daemon_channel_ = | 143 daemon_channel_.reset(new IPC::ChannelProxy(this, io_task_runner.get())); |
| 144 IPC::ChannelProxy::Create(daemon_channel_name_, IPC::Channel::MODE_CLIENT, | |
| 145 this, io_task_runner.get()); | |
| 146 | |
| 147 IPC::AttachmentBrokerUnprivileged::CreateBrokerIfNeeded(); | 144 IPC::AttachmentBrokerUnprivileged::CreateBrokerIfNeeded(); |
| 148 IPC::AttachmentBroker* broker = IPC::AttachmentBroker::GetGlobal(); | 145 IPC::AttachmentBroker* broker = IPC::AttachmentBroker::GetGlobal(); |
| 149 if (broker && !broker->IsPrivilegedBroker()) | 146 if (broker && !broker->IsPrivilegedBroker()) |
| 150 broker->RegisterBrokerCommunicationChannel(daemon_channel_.get()); | 147 broker->RegisterBrokerCommunicationChannel(daemon_channel_.get()); |
| 148 daemon_channel_->Init(daemon_channel_name_, IPC::Channel::MODE_CLIENT, true); |
| 151 | 149 |
| 152 // Pass |desktop_pipe| to the daemon. | 150 // Pass |desktop_pipe| to the daemon. |
| 153 daemon_channel_->Send( | 151 daemon_channel_->Send( |
| 154 new ChromotingDesktopDaemonMsg_DesktopAttached(desktop_pipe)); | 152 new ChromotingDesktopDaemonMsg_DesktopAttached(desktop_pipe)); |
| 155 | 153 |
| 156 return true; | 154 return true; |
| 157 } | 155 } |
| 158 | 156 |
| 159 void DesktopProcess::OnCrash(const std::string& function_name, | 157 void DesktopProcess::OnCrash(const std::string& function_name, |
| 160 const std::string& file_name, | 158 const std::string& file_name, |
| 161 const int& line_number) { | 159 const int& line_number) { |
| 162 char message[1024]; | 160 char message[1024]; |
| 163 base::snprintf(message, sizeof(message), | 161 base::snprintf(message, sizeof(message), |
| 164 "Requested by %s at %s, line %d.", | 162 "Requested by %s at %s, line %d.", |
| 165 function_name.c_str(), file_name.c_str(), line_number); | 163 function_name.c_str(), file_name.c_str(), line_number); |
| 166 base::debug::Alias(message); | 164 base::debug::Alias(message); |
| 167 | 165 |
| 168 // The daemon requested us to crash the process. | 166 // The daemon requested us to crash the process. |
| 169 CHECK(false) << message; | 167 CHECK(false) << message; |
| 170 } | 168 } |
| 171 | 169 |
| 172 } // namespace remoting | 170 } // namespace remoting |
| OLD | NEW |