Chromium Code Reviews| 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 // This file implements a standalone host process for Me2Me. | 5 // This file implements a standalone host process for Me2Me. |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 548 ShutdownHost(kInvalidHostConfigurationExitCode); | 548 ShutdownHost(kInvalidHostConfigurationExitCode); |
| 549 return; | 549 return; |
| 550 } | 550 } |
| 551 | 551 |
| 552 if (state_ == HOST_INITIALIZING) { | 552 if (state_ == HOST_INITIALIZING) { |
| 553 // TODO(sergeyu): Currently OnPolicyUpdate() assumes that host config is | 553 // TODO(sergeyu): Currently OnPolicyUpdate() assumes that host config is |
| 554 // already loaded so PolicyWatcher has to be started here. Separate policy | 554 // already loaded so PolicyWatcher has to be started here. Separate policy |
| 555 // loading from policy verifications and move |policy_watcher_| | 555 // loading from policy verifications and move |policy_watcher_| |
| 556 // initialization to StartOnNetworkThread(). | 556 // initialization to StartOnNetworkThread(). |
| 557 policy_watcher_ = policy_hack::PolicyWatcher::Create( | 557 policy_watcher_ = policy_hack::PolicyWatcher::Create( |
| 558 nullptr, context_->network_task_runner()); | 558 nullptr, context_->network_task_runner(), |
| 559 context_->network_task_runner()); | |
|
Łukasz Anforowicz
2015/01/30 05:35:55
I wonder if we should be using file_task_runner as
Sergey Ulanov
2015/01/30 19:33:45
Yes. Fixed.
| |
| 559 policy_watcher_->StartWatching( | 560 policy_watcher_->StartWatching( |
| 560 base::Bind(&HostProcess::OnPolicyUpdate, base::Unretained(this)), | 561 base::Bind(&HostProcess::OnPolicyUpdate, base::Unretained(this)), |
| 561 base::Bind(&HostProcess::OnPolicyError, base::Unretained(this))); | 562 base::Bind(&HostProcess::OnPolicyError, base::Unretained(this))); |
| 562 } else { | 563 } else { |
| 563 // Reapply policies that could be affected by a new config. | 564 // Reapply policies that could be affected by a new config. |
| 564 ApplyHostDomainPolicy(); | 565 ApplyHostDomainPolicy(); |
| 565 ApplyUsernamePolicy(); | 566 ApplyUsernamePolicy(); |
| 566 | 567 |
| 567 if (state_ == HOST_STARTED) { | 568 if (state_ == HOST_STARTED) { |
| 568 // TODO(sergeyu): Here we assume that PIN is the only part of the config | 569 // TODO(sergeyu): Here we assume that PIN is the only part of the config |
| (...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1516 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); | 1517 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); |
| 1517 new HostProcess(context.Pass(), &exit_code, &shutdown_watchdog); | 1518 new HostProcess(context.Pass(), &exit_code, &shutdown_watchdog); |
| 1518 | 1519 |
| 1519 // Run the main (also UI) message loop until the host no longer needs it. | 1520 // Run the main (also UI) message loop until the host no longer needs it. |
| 1520 message_loop.Run(); | 1521 message_loop.Run(); |
| 1521 | 1522 |
| 1522 return exit_code; | 1523 return exit_code; |
| 1523 } | 1524 } |
| 1524 | 1525 |
| 1525 } // namespace remoting | 1526 } // namespace remoting |
| OLD | NEW |