| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/heartbeat_sender.h" | 5 #include "remoting/host/heartbeat_sender.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 void HeartbeatSender::OnSignallingDisconnected() { | 82 void HeartbeatSender::OnSignallingDisconnected() { |
| 83 DCHECK_EQ(MessageLoop::current(), message_loop_); | 83 DCHECK_EQ(MessageLoop::current(), message_loop_); |
| 84 DCHECK_EQ(state_, STARTED); | 84 DCHECK_EQ(state_, STARTED); |
| 85 state_ = STOPPED; | 85 state_ = STOPPED; |
| 86 request_.reset(NULL); | 86 request_.reset(NULL); |
| 87 } | 87 } |
| 88 | 88 |
| 89 // Ignore any notifications other than signalling | 89 // Ignore any notifications other than signalling |
| 90 // connected/disconnected events. | 90 // connected/disconnected events. |
| 91 void HeartbeatSender::OnAccessDenied() { } | 91 void HeartbeatSender::OnAccessDenied() { } |
| 92 void HeartbeatSender::OnAuthenticatedClientsChanged(int clients) { } |
| 92 void HeartbeatSender::OnShutdown() { } | 93 void HeartbeatSender::OnShutdown() { } |
| 93 | 94 |
| 94 void HeartbeatSender::DoSendStanza() { | 95 void HeartbeatSender::DoSendStanza() { |
| 95 DCHECK_EQ(MessageLoop::current(), message_loop_); | 96 DCHECK_EQ(MessageLoop::current(), message_loop_); |
| 96 DCHECK_EQ(state_, STARTED); | 97 DCHECK_EQ(state_, STARTED); |
| 97 | 98 |
| 98 VLOG(1) << "Sending heartbeat stanza to " << kChromotingBotJid; | 99 VLOG(1) << "Sending heartbeat stanza to " << kChromotingBotJid; |
| 99 request_->SendIq(buzz::STR_SET, kChromotingBotJid, CreateHeartbeatMessage()); | 100 request_->SendIq(buzz::STR_SET, kChromotingBotJid, CreateHeartbeatMessage()); |
| 100 } | 101 } |
| 101 | 102 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 QName(kChromotingXmlNamespace, kSignatureTimeAttr), time_str); | 163 QName(kChromotingXmlNamespace, kSignatureTimeAttr), time_str); |
| 163 | 164 |
| 164 std::string message = full_jid_ + ' ' + time_str; | 165 std::string message = full_jid_ + ' ' + time_str; |
| 165 std::string signature(key_pair_.GetSignature(message)); | 166 std::string signature(key_pair_.GetSignature(message)); |
| 166 signature_tag->AddText(signature); | 167 signature_tag->AddText(signature); |
| 167 | 168 |
| 168 return signature_tag; | 169 return signature_tag; |
| 169 } | 170 } |
| 170 | 171 |
| 171 } // namespace remoting | 172 } // namespace remoting |
| OLD | NEW |