| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 const std::string& login, | 367 const std::string& login, |
| 368 const std::string& token, | 368 const std::string& token, |
| 369 const std::string& host_id, | 369 const std::string& host_id, |
| 370 const std::string& host_name, | 370 const std::string& host_name, |
| 371 remoting::HostKeyPair* host_key_pair) { | 371 remoting::HostKeyPair* host_key_pair) { |
| 372 // First we need to load the config first. | 372 // First we need to load the config first. |
| 373 LoadChromotingConfig(); | 373 LoadChromotingConfig(); |
| 374 | 374 |
| 375 // And then do the update. | 375 // And then do the update. |
| 376 chromoting_config_->Update( | 376 chromoting_config_->Update( |
| 377 NewRunnableFunction(&SaveChromotingConfigFunc, chromoting_config_.get(), | 377 NewRunnableFunction(&SaveChromotingConfigFunc, |
| 378 login, token, host_id, host_name)); | 378 chromoting_config_, |
| 379 login, |
| 380 token, |
| 381 host_id, |
| 382 host_name)); |
| 379 | 383 |
| 380 // And then save the key pair. | 384 // And then save the key pair. |
| 381 host_key_pair->Save(chromoting_config_); | 385 host_key_pair->Save(chromoting_config_); |
| 382 } | 386 } |
| 383 | 387 |
| 384 void ServiceProcess::LoadChromotingConfig() { | 388 void ServiceProcess::LoadChromotingConfig() { |
| 385 // TODO(hclam): We really should be doing this on IO thread so we are not | 389 // TODO(hclam): We really should be doing this on IO thread so we are not |
| 386 // blocked on file IOs. | 390 // blocked on file IOs. |
| 387 if (chromoting_config_) | 391 if (chromoting_config_) |
| 388 return; | 392 return; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 404 #endif | 408 #endif |
| 405 | 409 |
| 406 ServiceProcess::~ServiceProcess() { | 410 ServiceProcess::~ServiceProcess() { |
| 407 Teardown(); | 411 Teardown(); |
| 408 g_service_process = NULL; | 412 g_service_process = NULL; |
| 409 } | 413 } |
| 410 | 414 |
| 411 // Disable refcounting for runnable method because it is really not needed | 415 // Disable refcounting for runnable method because it is really not needed |
| 412 // when we post tasks on the main message loop. | 416 // when we post tasks on the main message loop. |
| 413 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcess); | 417 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcess); |
| OLD | NEW |