| 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> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
| 14 #include "base/debug/alias.h" | 14 #include "base/debug/alias.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
| 20 #include "ipc/attachment_broker_unprivileged.h" |
| 20 #include "ipc/ipc_channel_proxy.h" | 21 #include "ipc/ipc_channel_proxy.h" |
| 21 #include "remoting/base/auto_thread.h" | 22 #include "remoting/base/auto_thread.h" |
| 22 #include "remoting/base/auto_thread_task_runner.h" | 23 #include "remoting/base/auto_thread_task_runner.h" |
| 23 #include "remoting/host/chromoting_messages.h" | 24 #include "remoting/host/chromoting_messages.h" |
| 24 #include "remoting/host/desktop_environment.h" | 25 #include "remoting/host/desktop_environment.h" |
| 25 #include "remoting/host/desktop_session_agent.h" | 26 #include "remoting/host/desktop_session_agent.h" |
| 26 | 27 |
| 27 namespace remoting { | 28 namespace remoting { |
| 28 | 29 |
| 29 DesktopProcess::DesktopProcess( | 30 DesktopProcess::DesktopProcess( |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 caller_task_runner_ = nullptr; | 139 caller_task_runner_ = nullptr; |
| 139 input_task_runner_ = nullptr; | 140 input_task_runner_ = nullptr; |
| 140 desktop_environment_factory_.reset(); | 141 desktop_environment_factory_.reset(); |
| 141 return false; | 142 return false; |
| 142 } | 143 } |
| 143 | 144 |
| 144 // Connect to the daemon. | 145 // Connect to the daemon. |
| 145 daemon_channel_ = | 146 daemon_channel_ = |
| 146 IPC::ChannelProxy::Create(daemon_channel_name_, IPC::Channel::MODE_CLIENT, | 147 IPC::ChannelProxy::Create(daemon_channel_name_, IPC::Channel::MODE_CLIENT, |
| 147 this, io_task_runner.get()); | 148 this, io_task_runner.get()); |
| 149 attachment_broker_ = IPC::AttachmentBrokerUnprivileged::CreateBroker(); |
| 150 if (attachment_broker_) { |
| 151 attachment_broker_->DesignateBrokerCommunicationChannel( |
| 152 daemon_channel_.get()); |
| 153 } |
| 148 | 154 |
| 149 // Pass |desktop_pipe| to the daemon. | 155 // Pass |desktop_pipe| to the daemon. |
| 150 daemon_channel_->Send( | 156 daemon_channel_->Send( |
| 151 new ChromotingDesktopDaemonMsg_DesktopAttached(desktop_pipe)); | 157 new ChromotingDesktopDaemonMsg_DesktopAttached(desktop_pipe)); |
| 152 | 158 |
| 153 return true; | 159 return true; |
| 154 } | 160 } |
| 155 | 161 |
| 156 void DesktopProcess::OnCrash(const std::string& function_name, | 162 void DesktopProcess::OnCrash(const std::string& function_name, |
| 157 const std::string& file_name, | 163 const std::string& file_name, |
| 158 const int& line_number) { | 164 const int& line_number) { |
| 159 char message[1024]; | 165 char message[1024]; |
| 160 base::snprintf(message, sizeof(message), | 166 base::snprintf(message, sizeof(message), |
| 161 "Requested by %s at %s, line %d.", | 167 "Requested by %s at %s, line %d.", |
| 162 function_name.c_str(), file_name.c_str(), line_number); | 168 function_name.c_str(), file_name.c_str(), line_number); |
| 163 base::debug::Alias(message); | 169 base::debug::Alias(message); |
| 164 | 170 |
| 165 // The daemon requested us to crash the process. | 171 // The daemon requested us to crash the process. |
| 166 CHECK(false) << message; | 172 CHECK(false) << message; |
| 167 } | 173 } |
| 168 | 174 |
| 169 } // namespace remoting | 175 } // namespace remoting |
| OLD | NEW |