OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 void HeartbeatSender::OnSignallingDisconnected() { | 84 void HeartbeatSender::OnSignallingDisconnected() { |
85 DCHECK(message_loop_->BelongsToCurrentThread()); | 85 DCHECK(message_loop_->BelongsToCurrentThread()); |
86 state_ = STOPPED; | 86 state_ = STOPPED; |
87 request_.reset(NULL); | 87 request_.reset(NULL); |
88 } | 88 } |
89 | 89 |
90 // Ignore any notifications other than signalling | 90 // Ignore any notifications other than signalling |
91 // connected/disconnected events. | 91 // connected/disconnected events. |
92 void HeartbeatSender::OnAccessDenied() { } | 92 void HeartbeatSender::OnAccessDenied() { } |
93 void HeartbeatSender::OnClientAuthenticated( | 93 void HeartbeatSender::OnClientAuthenticated(const std::string& jid) { } |
94 remoting::protocol::ConnectionToClient* client) { } | 94 void HeartbeatSender::OnClientDisconnected(const std::string& jid) { } |
95 void HeartbeatSender::OnClientDisconnected( | |
96 remoting::protocol::ConnectionToClient* client) { } | |
97 void HeartbeatSender::OnShutdown() { } | 95 void HeartbeatSender::OnShutdown() { } |
98 | 96 |
99 void HeartbeatSender::DoSendStanza() { | 97 void HeartbeatSender::DoSendStanza() { |
100 DCHECK(message_loop_->BelongsToCurrentThread()); | 98 DCHECK(message_loop_->BelongsToCurrentThread()); |
101 DCHECK_EQ(state_, STARTED); | 99 DCHECK_EQ(state_, STARTED); |
102 | 100 |
103 VLOG(1) << "Sending heartbeat stanza to " << kChromotingBotJid; | 101 VLOG(1) << "Sending heartbeat stanza to " << kChromotingBotJid; |
104 request_->SendIq(IqRequest::MakeIqStanza( | 102 request_->SendIq(IqRequest::MakeIqStanza( |
105 buzz::STR_SET, kChromotingBotJid, CreateHeartbeatMessage())); | 103 buzz::STR_SET, kChromotingBotJid, CreateHeartbeatMessage())); |
106 } | 104 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 QName(kChromotingXmlNamespace, kSignatureTimeAttr), time_str); | 166 QName(kChromotingXmlNamespace, kSignatureTimeAttr), time_str); |
169 | 167 |
170 std::string message = full_jid_ + ' ' + time_str; | 168 std::string message = full_jid_ + ' ' + time_str; |
171 std::string signature(key_pair_.GetSignature(message)); | 169 std::string signature(key_pair_.GetSignature(message)); |
172 signature_tag->AddText(signature); | 170 signature_tag->AddText(signature); |
173 | 171 |
174 return signature_tag; | 172 return signature_tag; |
175 } | 173 } |
176 | 174 |
177 } // namespace remoting | 175 } // namespace remoting |
OLD | NEW |