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 // Attachment broker may be already created in tests. | 150 IPC::AttachmentBrokerUnprivileged::CreateBrokerIfNeeded(); |
151 if (!IPC::AttachmentBroker::GetGlobal()) | 151 IPC::AttachmentBroker* global = IPC::AttachmentBroker::GetGlobal(); |
Sergey Ulanov
2016/02/10 19:36:35
nit: call this broker instead of global.
erikchen
2016/02/10 21:04:46
Done.
| |
152 attachment_broker_ = IPC::AttachmentBrokerUnprivileged::CreateBroker(); | 152 if (global && !global->IsPrivilegedBroker()) |
153 | 153 global->DesignateBrokerCommunicationChannel(daemon_channel_.get()); |
154 if (attachment_broker_) { | |
155 attachment_broker_->DesignateBrokerCommunicationChannel( | |
156 daemon_channel_.get()); | |
157 } | |
158 | 154 |
159 // Pass |desktop_pipe| to the daemon. | 155 // Pass |desktop_pipe| to the daemon. |
160 daemon_channel_->Send( | 156 daemon_channel_->Send( |
161 new ChromotingDesktopDaemonMsg_DesktopAttached(desktop_pipe)); | 157 new ChromotingDesktopDaemonMsg_DesktopAttached(desktop_pipe)); |
162 | 158 |
163 return true; | 159 return true; |
164 } | 160 } |
165 | 161 |
166 void DesktopProcess::OnCrash(const std::string& function_name, | 162 void DesktopProcess::OnCrash(const std::string& function_name, |
167 const std::string& file_name, | 163 const std::string& file_name, |
168 const int& line_number) { | 164 const int& line_number) { |
169 char message[1024]; | 165 char message[1024]; |
170 base::snprintf(message, sizeof(message), | 166 base::snprintf(message, sizeof(message), |
171 "Requested by %s at %s, line %d.", | 167 "Requested by %s at %s, line %d.", |
172 function_name.c_str(), file_name.c_str(), line_number); | 168 function_name.c_str(), file_name.c_str(), line_number); |
173 base::debug::Alias(message); | 169 base::debug::Alias(message); |
174 | 170 |
175 // The daemon requested us to crash the process. | 171 // The daemon requested us to crash the process. |
176 CHECK(false) << message; | 172 CHECK(false) << message; |
177 } | 173 } |
178 | 174 |
179 } // namespace remoting | 175 } // namespace remoting |
OLD | NEW |