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 #include "remoting/host/daemon_process.h" | 5 #include "remoting/host/daemon_process.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 Stop(); | 219 Stop(); |
220 return; | 220 return; |
221 } | 221 } |
222 | 222 |
223 scoped_ptr<base::CommandLine> target(new base::CommandLine(host_binary)); | 223 scoped_ptr<base::CommandLine> target(new base::CommandLine(host_binary)); |
224 target->AppendSwitchASCII(kProcessTypeSwitchName, kProcessTypeHost); | 224 target->AppendSwitchASCII(kProcessTypeSwitchName, kProcessTypeHost); |
225 target->CopySwitchesFrom(*base::CommandLine::ForCurrentProcess(), | 225 target->CopySwitchesFrom(*base::CommandLine::ForCurrentProcess(), |
226 kCopiedSwitchNames, arraysize(kCopiedSwitchNames)); | 226 kCopiedSwitchNames, arraysize(kCopiedSwitchNames)); |
227 | 227 |
228 scoped_ptr<UnprivilegedProcessDelegate> delegate( | 228 scoped_ptr<UnprivilegedProcessDelegate> delegate( |
229 new UnprivilegedProcessDelegate(io_task_runner(), target.Pass())); | 229 new UnprivilegedProcessDelegate(io_task_runner(), std::move(target))); |
230 network_launcher_.reset(new WorkerProcessLauncher(delegate.Pass(), this)); | 230 network_launcher_.reset(new WorkerProcessLauncher(std::move(delegate), this)); |
231 } | 231 } |
232 | 232 |
233 scoped_ptr<DaemonProcess> DaemonProcess::Create( | 233 scoped_ptr<DaemonProcess> DaemonProcess::Create( |
234 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 234 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
235 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 235 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
236 const base::Closure& stopped_callback) { | 236 const base::Closure& stopped_callback) { |
237 scoped_ptr<DaemonProcessWin> daemon_process( | 237 scoped_ptr<DaemonProcessWin> daemon_process( |
238 new DaemonProcessWin(caller_task_runner, io_task_runner, | 238 new DaemonProcessWin(caller_task_runner, io_task_runner, |
239 stopped_callback)); | 239 stopped_callback)); |
240 daemon_process->Initialize(); | 240 daemon_process->Initialize(); |
241 return daemon_process.Pass(); | 241 return std::move(daemon_process); |
242 } | 242 } |
243 | 243 |
244 void DaemonProcessWin::DisableAutoStart() { | 244 void DaemonProcessWin::DisableAutoStart() { |
245 ScopedScHandle scmanager( | 245 ScopedScHandle scmanager( |
246 OpenSCManager(nullptr, SERVICES_ACTIVE_DATABASE, | 246 OpenSCManager(nullptr, SERVICES_ACTIVE_DATABASE, |
247 SC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE)); | 247 SC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE)); |
248 if (!scmanager.IsValid()) { | 248 if (!scmanager.IsValid()) { |
249 PLOG(INFO) << "Failed to connect to the service control manager"; | 249 PLOG(INFO) << "Failed to connect to the service control manager"; |
250 return; | 250 return; |
251 } | 251 } |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 << "\\" << kPairingRegistrySecretsKeyName; | 377 << "\\" << kPairingRegistrySecretsKeyName; |
378 return false; | 378 return false; |
379 } | 379 } |
380 | 380 |
381 pairing_registry_privileged_key_.Set(privileged.Take()); | 381 pairing_registry_privileged_key_.Set(privileged.Take()); |
382 pairing_registry_unprivileged_key_.Set(unprivileged.Take()); | 382 pairing_registry_unprivileged_key_.Set(unprivileged.Take()); |
383 return true; | 383 return true; |
384 } | 384 } |
385 | 385 |
386 } // namespace remoting | 386 } // namespace remoting |
OLD | NEW |