| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/setup/daemon_controller_delegate_win.h" | 5 #include "remoting/host/setup/daemon_controller_delegate_win.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 return ScopedScHandle(); | 249 return ScopedScHandle(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 ScopedScHandle service(::OpenServiceW(scmanager.Get(), kWindowsServiceName, | 252 ScopedScHandle service(::OpenServiceW(scmanager.Get(), kWindowsServiceName, |
| 253 access)); | 253 access)); |
| 254 if (!service.IsValid()) { | 254 if (!service.IsValid()) { |
| 255 PLOG(ERROR) << "Failed to open to the '" << kWindowsServiceName | 255 PLOG(ERROR) << "Failed to open to the '" << kWindowsServiceName |
| 256 << "' service"; | 256 << "' service"; |
| 257 } | 257 } |
| 258 | 258 |
| 259 return service.Pass(); | 259 return service; |
| 260 } | 260 } |
| 261 | 261 |
| 262 void InvokeCompletionCallback( | 262 void InvokeCompletionCallback( |
| 263 const DaemonController::CompletionCallback& done, bool success) { | 263 const DaemonController::CompletionCallback& done, bool success) { |
| 264 DaemonController::AsyncResult async_result = | 264 DaemonController::AsyncResult async_result = |
| 265 success ? DaemonController::RESULT_OK : DaemonController::RESULT_FAILED; | 265 success ? DaemonController::RESULT_OK : DaemonController::RESULT_FAILED; |
| 266 done.Run(async_result); | 266 done.Run(async_result); |
| 267 } | 267 } |
| 268 | 268 |
| 269 bool StartDaemon() { | 269 bool StartDaemon() { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 if (!WriteConfig(config_str)) { | 461 if (!WriteConfig(config_str)) { |
| 462 InvokeCompletionCallback(done, false); | 462 InvokeCompletionCallback(done, false); |
| 463 return; | 463 return; |
| 464 } | 464 } |
| 465 | 465 |
| 466 // Start daemon. | 466 // Start daemon. |
| 467 InvokeCompletionCallback(done, StartDaemon()); | 467 InvokeCompletionCallback(done, StartDaemon()); |
| 468 } | 468 } |
| 469 | 469 |
| 470 scoped_refptr<DaemonController> DaemonController::Create() { | 470 scoped_refptr<DaemonController> DaemonController::Create() { |
| 471 scoped_ptr<DaemonController::Delegate> delegate( | 471 return new DaemonController( |
| 472 new DaemonControllerDelegateWin()); | 472 make_scoped_ptr(new DaemonControllerDelegateWin())); |
| 473 return new DaemonController(delegate.Pass()); | |
| 474 } | 473 } |
| 475 | 474 |
| 476 } // namespace remoting | 475 } // namespace remoting |
| OLD | NEW |