| 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 #include "remoting/host/chromoting_host.h" | 5 #include "remoting/host/chromoting_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 // Destroy the session manager to make sure that |signal_strategy_| does not | 103 // Destroy the session manager to make sure that |signal_strategy_| does not |
| 104 // have any listeners registered. | 104 // have any listeners registered. |
| 105 session_manager_.reset(); | 105 session_manager_.reset(); |
| 106 | 106 |
| 107 // Notify observers. | 107 // Notify observers. |
| 108 if (started_) | 108 if (started_) |
| 109 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, OnShutdown()); | 109 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, OnShutdown()); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void ChromotingHost::Start(const std::string& xmpp_login) { | 112 void ChromotingHost::Start(const std::string& host_owner) { |
| 113 DCHECK(CalledOnValidThread()); | 113 DCHECK(CalledOnValidThread()); |
| 114 DCHECK(!started_); | 114 DCHECK(!started_); |
| 115 | 115 |
| 116 LOG(INFO) << "Starting host"; | 116 LOG(INFO) << "Starting host"; |
| 117 started_ = true; | 117 started_ = true; |
| 118 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, OnStart(xmpp_login)); | 118 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, OnStart(host_owner)); |
| 119 | 119 |
| 120 // Start the SessionManager, supplying this ChromotingHost as the listener. | 120 // Start the SessionManager, supplying this ChromotingHost as the listener. |
| 121 session_manager_->Init(signal_strategy_, this); | 121 session_manager_->Init(signal_strategy_, this); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void ChromotingHost::AddStatusObserver(HostStatusObserver* observer) { | 124 void ChromotingHost::AddStatusObserver(HostStatusObserver* observer) { |
| 125 DCHECK(CalledOnValidThread()); | 125 DCHECK(CalledOnValidThread()); |
| 126 status_observers_.AddObserver(observer); | 126 status_observers_.AddObserver(observer); |
| 127 } | 127 } |
| 128 | 128 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 DCHECK(CalledOnValidThread()); | 315 DCHECK(CalledOnValidThread()); |
| 316 | 316 |
| 317 while (!clients_.empty()) { | 317 while (!clients_.empty()) { |
| 318 size_t size = clients_.size(); | 318 size_t size = clients_.size(); |
| 319 clients_.front()->DisconnectSession(); | 319 clients_.front()->DisconnectSession(); |
| 320 CHECK_EQ(clients_.size(), size - 1); | 320 CHECK_EQ(clients_.size(), size - 1); |
| 321 } | 321 } |
| 322 } | 322 } |
| 323 | 323 |
| 324 } // namespace remoting | 324 } // namespace remoting |
| OLD | NEW |