| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 // Destroy the session manager to make sure that |signal_strategy_| does not | 107 // Destroy the session manager to make sure that |signal_strategy_| does not |
| 108 // have any listeners registered. | 108 // have any listeners registered. |
| 109 session_manager_.reset(); | 109 session_manager_.reset(); |
| 110 | 110 |
| 111 // Notify observers. | 111 // Notify observers. |
| 112 if (started_) | 112 if (started_) |
| 113 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, OnShutdown()); | 113 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, OnShutdown()); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void ChromotingHost::Start(const std::string& host_owner) { | 116 void ChromotingHost::Start(const std::string& host_owner_email) { |
| 117 DCHECK(CalledOnValidThread()); | 117 DCHECK(CalledOnValidThread()); |
| 118 DCHECK(!started_); | 118 DCHECK(!started_); |
| 119 | 119 |
| 120 HOST_LOG << "Starting host"; | 120 HOST_LOG << "Starting host"; |
| 121 started_ = true; | 121 started_ = true; |
| 122 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, OnStart(host_owner)); | 122 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, |
| 123 OnStart(host_owner_email)); |
| 123 | 124 |
| 124 // Start the SessionManager, supplying this ChromotingHost as the listener. | 125 // Start the SessionManager, supplying this ChromotingHost as the listener. |
| 125 session_manager_->Init(signal_strategy_, this); | 126 session_manager_->Init(signal_strategy_, this); |
| 126 } | 127 } |
| 127 | 128 |
| 128 void ChromotingHost::AddStatusObserver(HostStatusObserver* observer) { | 129 void ChromotingHost::AddStatusObserver(HostStatusObserver* observer) { |
| 129 DCHECK(CalledOnValidThread()); | 130 DCHECK(CalledOnValidThread()); |
| 130 status_observers_.AddObserver(observer); | 131 status_observers_.AddObserver(observer); |
| 131 } | 132 } |
| 132 | 133 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 DCHECK(CalledOnValidThread()); | 331 DCHECK(CalledOnValidThread()); |
| 331 | 332 |
| 332 while (!clients_.empty()) { | 333 while (!clients_.empty()) { |
| 333 size_t size = clients_.size(); | 334 size_t size = clients_.size(); |
| 334 clients_.front()->DisconnectSession(); | 335 clients_.front()->DisconnectSession(); |
| 335 CHECK_EQ(clients_.size(), size - 1); | 336 CHECK_EQ(clients_.size(), size - 1); |
| 336 } | 337 } |
| 337 } | 338 } |
| 338 | 339 |
| 339 } // namespace remoting | 340 } // namespace remoting |
| OLD | NEW |