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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 input_task_runner_ = nullptr; | 140 input_task_runner_ = nullptr; |
141 desktop_environment_factory_.reset(); | 141 desktop_environment_factory_.reset(); |
142 return false; | 142 return false; |
143 } | 143 } |
144 | 144 |
145 // Connect to the daemon. | 145 // Connect to the daemon. |
146 daemon_channel_ = | 146 daemon_channel_ = |
147 IPC::ChannelProxy::Create(daemon_channel_name_, IPC::Channel::MODE_CLIENT, | 147 IPC::ChannelProxy::Create(daemon_channel_name_, IPC::Channel::MODE_CLIENT, |
148 this, io_task_runner.get()); | 148 this, io_task_runner.get()); |
149 | 149 |
150 IPC::AttachmentBrokerUnprivileged::CreateBrokerIfNeeded(); | 150 // Attachment broker may be already created in tests. |
151 IPC::AttachmentBroker* broker = IPC::AttachmentBroker::GetGlobal(); | 151 if (!IPC::AttachmentBroker::GetGlobal()) |
152 if (broker && !broker->IsPrivilegedBroker()) | 152 attachment_broker_ = IPC::AttachmentBrokerUnprivileged::CreateBroker(); |
153 broker->DesignateBrokerCommunicationChannel(daemon_channel_.get()); | 153 |
| 154 if (attachment_broker_) { |
| 155 attachment_broker_->DesignateBrokerCommunicationChannel( |
| 156 daemon_channel_.get()); |
| 157 } |
154 | 158 |
155 // Pass |desktop_pipe| to the daemon. | 159 // Pass |desktop_pipe| to the daemon. |
156 daemon_channel_->Send( | 160 daemon_channel_->Send( |
157 new ChromotingDesktopDaemonMsg_DesktopAttached(desktop_pipe)); | 161 new ChromotingDesktopDaemonMsg_DesktopAttached(desktop_pipe)); |
158 | 162 |
159 return true; | 163 return true; |
160 } | 164 } |
161 | 165 |
162 void DesktopProcess::OnCrash(const std::string& function_name, | 166 void DesktopProcess::OnCrash(const std::string& function_name, |
163 const std::string& file_name, | 167 const std::string& file_name, |
164 const int& line_number) { | 168 const int& line_number) { |
165 char message[1024]; | 169 char message[1024]; |
166 base::snprintf(message, sizeof(message), | 170 base::snprintf(message, sizeof(message), |
167 "Requested by %s at %s, line %d.", | 171 "Requested by %s at %s, line %d.", |
168 function_name.c_str(), file_name.c_str(), line_number); | 172 function_name.c_str(), file_name.c_str(), line_number); |
169 base::debug::Alias(message); | 173 base::debug::Alias(message); |
170 | 174 |
171 // The daemon requested us to crash the process. | 175 // The daemon requested us to crash the process. |
172 CHECK(false) << message; | 176 CHECK(false) << message; |
173 } | 177 } |
174 | 178 |
175 } // namespace remoting | 179 } // namespace remoting |
OLD | NEW |