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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 } | 214 } |
215 | 215 |
216 scoped_ptr<CommandLine> target(new CommandLine(host_binary)); | 216 scoped_ptr<CommandLine> target(new CommandLine(host_binary)); |
217 target->AppendSwitchASCII(kProcessTypeSwitchName, kProcessTypeHost); | 217 target->AppendSwitchASCII(kProcessTypeSwitchName, kProcessTypeHost); |
218 target->CopySwitchesFrom(*CommandLine::ForCurrentProcess(), | 218 target->CopySwitchesFrom(*CommandLine::ForCurrentProcess(), |
219 kCopiedSwitchNames, | 219 kCopiedSwitchNames, |
220 arraysize(kCopiedSwitchNames)); | 220 arraysize(kCopiedSwitchNames)); |
221 | 221 |
222 scoped_ptr<UnprivilegedProcessDelegate> delegate( | 222 scoped_ptr<UnprivilegedProcessDelegate> delegate( |
223 new UnprivilegedProcessDelegate(io_task_runner(), target.Pass())); | 223 new UnprivilegedProcessDelegate(io_task_runner(), target.Pass())); |
224 network_launcher_.reset(new WorkerProcessLauncher( | 224 network_launcher_.reset(new WorkerProcessLauncher(delegate.Pass(), this)); |
225 delegate.PassAs<WorkerProcessLauncher::Delegate>(), this)); | |
226 } | 225 } |
227 | 226 |
228 scoped_ptr<DaemonProcess> DaemonProcess::Create( | 227 scoped_ptr<DaemonProcess> DaemonProcess::Create( |
229 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 228 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
230 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 229 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
231 const base::Closure& stopped_callback) { | 230 const base::Closure& stopped_callback) { |
232 scoped_ptr<DaemonProcessWin> daemon_process( | 231 scoped_ptr<DaemonProcessWin> daemon_process( |
233 new DaemonProcessWin(caller_task_runner, io_task_runner, | 232 new DaemonProcessWin(caller_task_runner, io_task_runner, |
234 stopped_callback)); | 233 stopped_callback)); |
235 daemon_process->Initialize(); | 234 daemon_process->Initialize(); |
236 return daemon_process.PassAs<DaemonProcess>(); | 235 return daemon_process.Pass(); |
237 } | 236 } |
238 | 237 |
239 void DaemonProcessWin::DisableAutoStart() { | 238 void DaemonProcessWin::DisableAutoStart() { |
240 ScopedScHandle scmanager( | 239 ScopedScHandle scmanager( |
241 OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE, | 240 OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE, |
242 SC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE)); | 241 SC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE)); |
243 if (!scmanager.IsValid()) { | 242 if (!scmanager.IsValid()) { |
244 PLOG(INFO) << "Failed to connect to the service control manager"; | 243 PLOG(INFO) << "Failed to connect to the service control manager"; |
245 return; | 244 return; |
246 } | 245 } |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 << "\\" << kPairingRegistrySecretsKeyName; | 326 << "\\" << kPairingRegistrySecretsKeyName; |
328 return false; | 327 return false; |
329 } | 328 } |
330 | 329 |
331 pairing_registry_privileged_key_.Set(privileged.Take()); | 330 pairing_registry_privileged_key_.Set(privileged.Take()); |
332 pairing_registry_unprivileged_key_.Set(unprivileged.Take()); | 331 pairing_registry_unprivileged_key_.Set(unprivileged.Take()); |
333 return true; | 332 return true; |
334 } | 333 } |
335 | 334 |
336 } // namespace remoting | 335 } // namespace remoting |
OLD | NEW |