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/heartbeat_sender.h" | 5 #include "remoting/host/heartbeat_sender.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(interval_ms_), | 81 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(interval_ms_), |
82 this, &HeartbeatSender::SendStanza); | 82 this, &HeartbeatSender::SendStanza); |
83 } else if (state == SignalStrategy::DISCONNECTED) { | 83 } else if (state == SignalStrategy::DISCONNECTED) { |
84 request_.reset(); | 84 request_.reset(); |
85 iq_sender_.reset(); | 85 iq_sender_.reset(); |
86 timer_.Stop(); | 86 timer_.Stop(); |
87 timer_resend_.Stop(); | 87 timer_resend_.Stop(); |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
| 91 bool HeartbeatSender::OnSignalStrategyIncomingStanza( |
| 92 const buzz::XmlElement* stanza) { |
| 93 return false; |
| 94 } |
| 95 |
91 void HeartbeatSender::SendStanza() { | 96 void HeartbeatSender::SendStanza() { |
92 DoSendStanza(); | 97 DoSendStanza(); |
93 // Make sure we don't send another heartbeat before the heartbeat interval | 98 // Make sure we don't send another heartbeat before the heartbeat interval |
94 // has expired. | 99 // has expired. |
95 timer_resend_.Stop(); | 100 timer_resend_.Stop(); |
96 } | 101 } |
97 | 102 |
98 void HeartbeatSender::ResendStanza() { | 103 void HeartbeatSender::ResendStanza() { |
99 DoSendStanza(); | 104 DoSendStanza(); |
100 // Make sure we don't send another heartbeat before the heartbeat interval | 105 // Make sure we don't send another heartbeat before the heartbeat interval |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 256 |
252 std::string message = signal_strategy_->GetLocalJid() + ' ' + | 257 std::string message = signal_strategy_->GetLocalJid() + ' ' + |
253 base::IntToString(sequence_id_); | 258 base::IntToString(sequence_id_); |
254 std::string signature(key_pair_->GetSignature(message)); | 259 std::string signature(key_pair_->GetSignature(message)); |
255 signature_tag->AddText(signature); | 260 signature_tag->AddText(signature); |
256 | 261 |
257 return signature_tag.Pass(); | 262 return signature_tag.Pass(); |
258 } | 263 } |
259 | 264 |
260 } // namespace remoting | 265 } // namespace remoting |
OLD | NEW |