| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/service/service_process.h" | 5 #include "chrome/service/service_process.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 return true; | 266 return true; |
| 267 | 267 |
| 268 // Load chromoting config from the disk. | 268 // Load chromoting config from the disk. |
| 269 LoadChromotingConfig(); | 269 LoadChromotingConfig(); |
| 270 | 270 |
| 271 // Start the chromoting context first. | 271 // Start the chromoting context first. |
| 272 chromoting_context_.reset(new remoting::ChromotingHostContext()); | 272 chromoting_context_.reset(new remoting::ChromotingHostContext()); |
| 273 chromoting_context_->Start(); | 273 chromoting_context_->Start(); |
| 274 | 274 |
| 275 // Create a chromoting host object. | 275 // Create a chromoting host object. |
| 276 chromoting_host_ = new remoting::ChromotingHost(chromoting_context_.get(), | 276 chromoting_host_ = remoting::ChromotingHost::Create(chromoting_context_.get(), |
| 277 chromoting_config_); | 277 chromoting_config_); |
| 278 | 278 |
| 279 // Then start the chromoting host. | 279 // Then start the chromoting host. |
| 280 // When ChromotingHost is shutdown because of failure or a request that | 280 // When ChromotingHost is shutdown because of failure or a request that |
| 281 // we made OnChromotingShutdown() is calls. | 281 // we made OnChromotingShutdown() is calls. |
| 282 chromoting_host_->Start( | 282 chromoting_host_->Start( |
| 283 NewRunnableMethod(this, &ServiceProcess::OnChromotingHostShutdown)); | 283 NewRunnableMethod(this, &ServiceProcess::OnChromotingHostShutdown)); |
| 284 OnServiceEnabled(); | 284 OnServiceEnabled(); |
| 285 return true; | 285 return true; |
| 286 } | 286 } |
| 287 | 287 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 #endif | 388 #endif |
| 389 | 389 |
| 390 ServiceProcess::~ServiceProcess() { | 390 ServiceProcess::~ServiceProcess() { |
| 391 Teardown(); | 391 Teardown(); |
| 392 g_service_process = NULL; | 392 g_service_process = NULL; |
| 393 } | 393 } |
| 394 | 394 |
| 395 // Disable refcounting for runnable method because it is really not needed | 395 // Disable refcounting for runnable method because it is really not needed |
| 396 // when we post tasks on the main message loop. | 396 // when we post tasks on the main message loop. |
| 397 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcess); | 397 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcess); |
| OLD | NEW |