| 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/log_to_server.h" | 5 #include "remoting/host/log_to_server.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
| 9 #include "remoting/base/constants.h" | 9 #include "remoting/base/constants.h" |
| 10 #include "remoting/host/host_status_monitor.h" | 10 #include "remoting/host/host_status_monitor.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 : monitor_(monitor), | 27 : monitor_(monitor), |
| 28 mode_(mode), | 28 mode_(mode), |
| 29 signal_strategy_(signal_strategy), | 29 signal_strategy_(signal_strategy), |
| 30 directory_bot_jid_(directory_bot_jid) { | 30 directory_bot_jid_(directory_bot_jid) { |
| 31 monitor_->AddStatusObserver(this); | 31 monitor_->AddStatusObserver(this); |
| 32 signal_strategy_->AddListener(this); | 32 signal_strategy_->AddListener(this); |
| 33 } | 33 } |
| 34 | 34 |
| 35 LogToServer::~LogToServer() { | 35 LogToServer::~LogToServer() { |
| 36 signal_strategy_->RemoveListener(this); | 36 signal_strategy_->RemoveListener(this); |
| 37 if (monitor_) | 37 if (monitor_.get()) |
| 38 monitor_->RemoveStatusObserver(this); | 38 monitor_->RemoveStatusObserver(this); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void LogToServer::LogSessionStateChange(const std::string& jid, | 41 void LogToServer::LogSessionStateChange(const std::string& jid, |
| 42 bool connected) { | 42 bool connected) { |
| 43 DCHECK(CalledOnValidThread()); | 43 DCHECK(CalledOnValidThread()); |
| 44 | 44 |
| 45 scoped_ptr<ServerLogEntry> entry( | 45 scoped_ptr<ServerLogEntry> entry( |
| 46 ServerLogEntry::MakeForSessionStateChange(connected)); | 46 ServerLogEntry::MakeForSessionStateChange(connected)); |
| 47 entry->AddHostFields(); | 47 entry->AddHostFields(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } | 112 } |
| 113 // Send the stanza to the server. | 113 // Send the stanza to the server. |
| 114 scoped_ptr<IqRequest> req = iq_sender_->SendIq( | 114 scoped_ptr<IqRequest> req = iq_sender_->SendIq( |
| 115 buzz::STR_SET, directory_bot_jid_, stanza.Pass(), | 115 buzz::STR_SET, directory_bot_jid_, stanza.Pass(), |
| 116 IqSender::ReplyCallback()); | 116 IqSender::ReplyCallback()); |
| 117 // We ignore any response, so let the IqRequest be destroyed. | 117 // We ignore any response, so let the IqRequest be destroyed. |
| 118 return; | 118 return; |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace remoting | 121 } // namespace remoting |
| OLD | NEW |