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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 const std::string& login, | 379 const std::string& login, |
380 const std::string& token, | 380 const std::string& token, |
381 const std::string& host_id, | 381 const std::string& host_id, |
382 const std::string& host_name, | 382 const std::string& host_name, |
383 remoting::HostKeyPair* host_key_pair) { | 383 remoting::HostKeyPair* host_key_pair) { |
384 // First we need to load the config first. | 384 // First we need to load the config first. |
385 LoadChromotingConfig(); | 385 LoadChromotingConfig(); |
386 | 386 |
387 // And then do the update. | 387 // And then do the update. |
388 chromoting_config_->Update( | 388 chromoting_config_->Update( |
389 NewRunnableFunction(&SaveChromotingConfigFunc, | 389 NewRunnableFunction(&SaveChromotingConfigFunc, chromoting_config_.get(), |
390 chromoting_config_, | 390 login, token, host_id, host_name)); |
391 login, | |
392 token, | |
393 host_id, | |
394 host_name)); | |
395 | 391 |
396 // And then save the key pair. | 392 // And then save the key pair. |
397 host_key_pair->Save(chromoting_config_); | 393 host_key_pair->Save(chromoting_config_); |
398 } | 394 } |
399 | 395 |
400 void ServiceProcess::LoadChromotingConfig() { | 396 void ServiceProcess::LoadChromotingConfig() { |
401 // TODO(hclam): We really should be doing this on IO thread so we are not | 397 // TODO(hclam): We really should be doing this on IO thread so we are not |
402 // blocked on file IOs. | 398 // blocked on file IOs. |
403 if (chromoting_config_) | 399 if (chromoting_config_) |
404 return; | 400 return; |
(...skipping 15 matching lines...) Expand all Loading... |
420 #endif | 416 #endif |
421 | 417 |
422 ServiceProcess::~ServiceProcess() { | 418 ServiceProcess::~ServiceProcess() { |
423 Teardown(); | 419 Teardown(); |
424 g_service_process = NULL; | 420 g_service_process = NULL; |
425 } | 421 } |
426 | 422 |
427 // Disable refcounting for runnable method because it is really not needed | 423 // Disable refcounting for runnable method because it is really not needed |
428 // when we post tasks on the main message loop. | 424 // when we post tasks on the main message loop. |
429 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcess); | 425 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcess); |
OLD | NEW |