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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 DoSendStanza(); | 78 DoSendStanza(); |
79 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(interval_ms_), this, | 79 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(interval_ms_), this, |
80 &HeartbeatSender::DoSendStanza); | 80 &HeartbeatSender::DoSendStanza); |
81 } | 81 } |
82 | 82 |
83 void HeartbeatSender::OnSignallingDisconnected() { | 83 void HeartbeatSender::OnSignallingDisconnected() { |
84 DCHECK(message_loop_->BelongsToCurrentThread()); | 84 DCHECK(message_loop_->BelongsToCurrentThread()); |
85 state_ = STOPPED; | 85 state_ = STOPPED; |
86 request_.reset(); | 86 request_.reset(); |
87 iq_sender_.reset(); | 87 iq_sender_.reset(); |
| 88 timer_.Stop(); |
88 } | 89 } |
89 | 90 |
90 // Ignore any notifications other than signalling | 91 // Ignore any notifications other than signalling |
91 // connected/disconnected events. | 92 // connected/disconnected events. |
92 void HeartbeatSender::OnAccessDenied() { } | 93 void HeartbeatSender::OnAccessDenied() { } |
93 void HeartbeatSender::OnClientAuthenticated(const std::string& jid) { } | 94 void HeartbeatSender::OnClientAuthenticated(const std::string& jid) { } |
94 void HeartbeatSender::OnClientDisconnected(const std::string& jid) { } | 95 void HeartbeatSender::OnClientDisconnected(const std::string& jid) { } |
95 void HeartbeatSender::OnShutdown() { } | 96 void HeartbeatSender::OnShutdown() { } |
96 | 97 |
97 void HeartbeatSender::DoSendStanza() { | 98 void HeartbeatSender::DoSendStanza() { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 QName(kChromotingXmlNamespace, kSignatureTimeAttr), time_str); | 169 QName(kChromotingXmlNamespace, kSignatureTimeAttr), time_str); |
169 | 170 |
170 std::string message = full_jid_ + ' ' + time_str; | 171 std::string message = full_jid_ + ' ' + time_str; |
171 std::string signature(key_pair_.GetSignature(message)); | 172 std::string signature(key_pair_.GetSignature(message)); |
172 signature_tag->AddText(signature); | 173 signature_tag->AddText(signature); |
173 | 174 |
174 return signature_tag; | 175 return signature_tag; |
175 } | 176 } |
176 | 177 |
177 } // namespace remoting | 178 } // namespace remoting |
OLD | NEW |