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 "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 74 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
75 | 75 |
76 VLOG(1) << "IPC: desktop <- daemon (" << peer_pid << ")"; | 76 VLOG(1) << "IPC: desktop <- daemon (" << peer_pid << ")"; |
77 } | 77 } |
78 | 78 |
79 void DesktopProcess::OnChannelError() { | 79 void DesktopProcess::OnChannelError() { |
80 // Shutdown the desktop process. | 80 // Shutdown the desktop process. |
81 daemon_channel_.reset(); | 81 daemon_channel_.reset(); |
82 if (desktop_agent_.get()) { | 82 if (desktop_agent_.get()) { |
83 desktop_agent_->Stop(); | 83 desktop_agent_->Stop(); |
84 desktop_agent_ = NULL; | 84 desktop_agent_ = nullptr; |
85 } | 85 } |
86 | 86 |
87 caller_task_runner_ = NULL; | 87 caller_task_runner_ = nullptr; |
88 input_task_runner_ = NULL; | 88 input_task_runner_ = nullptr; |
89 desktop_environment_factory_.reset(); | 89 desktop_environment_factory_.reset(); |
90 } | 90 } |
91 | 91 |
92 bool DesktopProcess::Start( | 92 bool DesktopProcess::Start( |
93 scoped_ptr<DesktopEnvironmentFactory> desktop_environment_factory) { | 93 scoped_ptr<DesktopEnvironmentFactory> desktop_environment_factory) { |
94 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 94 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
95 DCHECK(!desktop_environment_factory_); | 95 DCHECK(!desktop_environment_factory_); |
96 DCHECK(desktop_environment_factory); | 96 DCHECK(desktop_environment_factory); |
97 | 97 |
98 desktop_environment_factory_ = desktop_environment_factory.Pass(); | 98 desktop_environment_factory_ = desktop_environment_factory.Pass(); |
(...skipping 25 matching lines...) Expand all Loading... |
124 // Create a desktop agent. | 124 // Create a desktop agent. |
125 desktop_agent_ = new DesktopSessionAgent(audio_task_runner, | 125 desktop_agent_ = new DesktopSessionAgent(audio_task_runner, |
126 caller_task_runner_, | 126 caller_task_runner_, |
127 input_task_runner_, | 127 input_task_runner_, |
128 io_task_runner, | 128 io_task_runner, |
129 video_capture_task_runner); | 129 video_capture_task_runner); |
130 | 130 |
131 // Start the agent and create an IPC channel to talk to it. | 131 // Start the agent and create an IPC channel to talk to it. |
132 IPC::PlatformFileForTransit desktop_pipe; | 132 IPC::PlatformFileForTransit desktop_pipe; |
133 if (!desktop_agent_->Start(AsWeakPtr(), &desktop_pipe)) { | 133 if (!desktop_agent_->Start(AsWeakPtr(), &desktop_pipe)) { |
134 desktop_agent_ = NULL; | 134 desktop_agent_ = nullptr; |
135 caller_task_runner_ = NULL; | 135 caller_task_runner_ = nullptr; |
136 input_task_runner_ = NULL; | 136 input_task_runner_ = nullptr; |
137 desktop_environment_factory_.reset(); | 137 desktop_environment_factory_.reset(); |
138 return false; | 138 return false; |
139 } | 139 } |
140 | 140 |
141 // Connect to the daemon. | 141 // Connect to the daemon. |
142 daemon_channel_ = IPC::ChannelProxy::Create(daemon_channel_name_, | 142 daemon_channel_ = IPC::ChannelProxy::Create(daemon_channel_name_, |
143 IPC::Channel::MODE_CLIENT, | 143 IPC::Channel::MODE_CLIENT, |
144 this, | 144 this, |
145 io_task_runner.get()); | 145 io_task_runner.get()); |
146 | 146 |
(...skipping 11 matching lines...) Expand all Loading... |
158 base::snprintf(message, sizeof(message), | 158 base::snprintf(message, sizeof(message), |
159 "Requested by %s at %s, line %d.", | 159 "Requested by %s at %s, line %d.", |
160 function_name.c_str(), file_name.c_str(), line_number); | 160 function_name.c_str(), file_name.c_str(), line_number); |
161 base::debug::Alias(message); | 161 base::debug::Alias(message); |
162 | 162 |
163 // The daemon requested us to crash the process. | 163 // The daemon requested us to crash the process. |
164 CHECK(false) << message; | 164 CHECK(false) << message; |
165 } | 165 } |
166 | 166 |
167 } // namespace remoting | 167 } // namespace remoting |
OLD | NEW |