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 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 host_change_notification_listener_.reset(); | 1440 host_change_notification_listener_.reset(); |
1441 | 1441 |
1442 if (state_ == HOST_STOPPING_TO_RESTART) { | 1442 if (state_ == HOST_STOPPING_TO_RESTART) { |
1443 StartHost(); | 1443 StartHost(); |
1444 } else if (state_ == HOST_STOPPING) { | 1444 } else if (state_ == HOST_STOPPING) { |
1445 state_ = HOST_STOPPED; | 1445 state_ = HOST_STOPPED; |
1446 | 1446 |
1447 shutdown_watchdog_->SetExitCode(*exit_code_out_); | 1447 shutdown_watchdog_->SetExitCode(*exit_code_out_); |
1448 shutdown_watchdog_->Arm(); | 1448 shutdown_watchdog_->Arm(); |
1449 | 1449 |
| 1450 config_watcher_.reset(); |
| 1451 |
1450 if (policy_watcher_.get()) { | 1452 if (policy_watcher_.get()) { |
1451 policy_watcher_->StopWatching( | 1453 policy_watcher_->StopWatching( |
1452 base::Bind(&HostProcess::OnPolicyWatcherShutdown, this)); | 1454 base::Bind(&HostProcess::OnPolicyWatcherShutdown, this)); |
1453 } else { | 1455 } else { |
1454 OnPolicyWatcherShutdown(); | 1456 OnPolicyWatcherShutdown(); |
1455 } | 1457 } |
1456 } else { | 1458 } else { |
1457 // This method is only called in STOPPING_TO_RESTART and STOPPING states. | 1459 // This method is only called in STOPPING_TO_RESTART and STOPPING states. |
1458 NOTREACHED(); | 1460 NOTREACHED(); |
1459 } | 1461 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); | 1516 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); |
1515 new HostProcess(context.Pass(), &exit_code, &shutdown_watchdog); | 1517 new HostProcess(context.Pass(), &exit_code, &shutdown_watchdog); |
1516 | 1518 |
1517 // Run the main (also UI) message loop until the host no longer needs it. | 1519 // Run the main (also UI) message loop until the host no longer needs it. |
1518 message_loop.Run(); | 1520 message_loop.Run(); |
1519 | 1521 |
1520 return exit_code; | 1522 return exit_code; |
1521 } | 1523 } |
1522 | 1524 |
1523 } // namespace remoting | 1525 } // namespace remoting |
OLD | NEW |