| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 return; | 178 return; |
| 179 } | 179 } |
| 180 | 180 |
| 181 scoped_ptr<CommandLine> target(new CommandLine(host_binary)); | 181 scoped_ptr<CommandLine> target(new CommandLine(host_binary)); |
| 182 target->AppendSwitchASCII(kProcessTypeSwitchName, kProcessTypeHost); | 182 target->AppendSwitchASCII(kProcessTypeSwitchName, kProcessTypeHost); |
| 183 target->CopySwitchesFrom(*CommandLine::ForCurrentProcess(), | 183 target->CopySwitchesFrom(*CommandLine::ForCurrentProcess(), |
| 184 kCopiedSwitchNames, | 184 kCopiedSwitchNames, |
| 185 arraysize(kCopiedSwitchNames)); | 185 arraysize(kCopiedSwitchNames)); |
| 186 | 186 |
| 187 scoped_ptr<UnprivilegedProcessDelegate> delegate( | 187 scoped_ptr<UnprivilegedProcessDelegate> delegate( |
| 188 new UnprivilegedProcessDelegate(caller_task_runner(), io_task_runner(), | 188 new UnprivilegedProcessDelegate(io_task_runner(), target.Pass())); |
| 189 target.Pass())); | 189 network_launcher_.reset(new WorkerProcessLauncher(delegate.Pass(), this)); |
| 190 network_launcher_.reset(new WorkerProcessLauncher( | |
| 191 caller_task_runner(), delegate.Pass(), this)); | |
| 192 } | 190 } |
| 193 | 191 |
| 194 scoped_ptr<DaemonProcess> DaemonProcess::Create( | 192 scoped_ptr<DaemonProcess> DaemonProcess::Create( |
| 195 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 193 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
| 196 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 194 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
| 197 const base::Closure& stopped_callback) { | 195 const base::Closure& stopped_callback) { |
| 198 scoped_ptr<DaemonProcessWin> daemon_process( | 196 scoped_ptr<DaemonProcessWin> daemon_process( |
| 199 new DaemonProcessWin(caller_task_runner, io_task_runner, | 197 new DaemonProcessWin(caller_task_runner, io_task_runner, |
| 200 stopped_callback)); | 198 stopped_callback)); |
| 201 daemon_process->Initialize(); | 199 daemon_process->Initialize(); |
| 202 return daemon_process.PassAs<DaemonProcess>(); | 200 return daemon_process.PassAs<DaemonProcess>(); |
| 203 } | 201 } |
| 204 | 202 |
| 205 } // namespace remoting | 203 } // namespace remoting |
| OLD | NEW |