| Index: remoting/host/simple_host_process.cc
|
| diff --git a/remoting/host/simple_host_process.cc b/remoting/host/simple_host_process.cc
|
| index f37d7a979077543847a97c3c11f3a73e1d2cd122..aadc49c35eba5bcf893ec6305147ae403d49106e 100644
|
| --- a/remoting/host/simple_host_process.cc
|
| +++ b/remoting/host/simple_host_process.cc
|
| @@ -89,7 +89,7 @@ const char kVideoSwitchValueVp8Rtp[] = "vp8rtp";
|
|
|
| namespace remoting {
|
|
|
| -class SimpleHost {
|
| +class SimpleHost : public HeartbeatSender::Delegate {
|
| public:
|
| SimpleHost()
|
| : message_loop_(MessageLoop::TYPE_UI),
|
| @@ -102,6 +102,12 @@ class SimpleHost {
|
| network_change_notifier_.reset(net::NetworkChangeNotifier::Create());
|
| }
|
|
|
| + // Overridden from HeartbeatSender::Delegate
|
| + virtual void OnUnknownHostIdError() OVERRIDE {
|
| + LOG(ERROR) << "Host ID not found.";
|
| + Shutdown();
|
| + }
|
| +
|
| int Run() {
|
| FilePath config_path = GetConfigPath();
|
| JsonHostConfig config(config_path);
|
| @@ -246,8 +252,8 @@ class SimpleHost {
|
| signal_strategy_.get(), &key_pair_,
|
| base::Bind(&SimpleHost::SetIT2MeAccessCode, host_, &key_pair_)));
|
| } else {
|
| - heartbeat_sender_.reset(
|
| - new HeartbeatSender(host_id_, signal_strategy_.get(), &key_pair_));
|
| + heartbeat_sender_.reset(new HeartbeatSender(
|
| + this, host_id_, signal_strategy_.get(), &key_pair_));
|
| }
|
|
|
| host_->Start();
|
| @@ -262,6 +268,10 @@ class SimpleHost {
|
| }
|
| }
|
|
|
| + void Shutdown() {
|
| + message_loop_.PostTask(FROM_HERE, MessageLoop::QuitClosure());
|
| + }
|
| +
|
| MessageLoop message_loop_;
|
| base::Thread file_io_thread_;
|
| ChromotingHostContext context_;
|
|
|