| 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/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| 11 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/stringize_macros.h" | 13 #include "base/strings/stringize_macros.h" |
| 14 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "remoting/base/constants.h" | 16 #include "remoting/base/constants.h" |
| 17 #include "remoting/base/logging.h" | 17 #include "remoting/base/logging.h" |
| 18 #include "remoting/host/server_log_entry_host.h" | 18 #include "remoting/host/server_log_entry_host.h" |
| 19 #include "remoting/signaling/iq_sender.h" | 19 #include "remoting/signaling/iq_sender.h" |
| 20 #include "remoting/signaling/jid_util.h" |
| 20 #include "remoting/signaling/server_log_entry.h" | 21 #include "remoting/signaling/server_log_entry.h" |
| 21 #include "remoting/signaling/signal_strategy.h" | 22 #include "remoting/signaling/signal_strategy.h" |
| 22 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" | 23 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" |
| 23 #include "third_party/webrtc/libjingle/xmpp/constants.h" | 24 #include "third_party/webrtc/libjingle/xmpp/constants.h" |
| 24 | 25 |
| 25 using buzz::QName; | 26 using buzz::QName; |
| 26 using buzz::XmlElement; | 27 using buzz::XmlElement; |
| 27 | 28 |
| 28 namespace remoting { | 29 namespace remoting { |
| 29 | 30 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 AddHostFieldsToLogEntry(log_entry.get()); | 325 AddHostFieldsToLogEntry(log_entry.get()); |
| 325 log->AddElement(log_entry->ToStanza().release()); | 326 log->AddElement(log_entry->ToStanza().release()); |
| 326 heartbeat->AddElement(log.release()); | 327 heartbeat->AddElement(log.release()); |
| 327 return heartbeat.Pass(); | 328 return heartbeat.Pass(); |
| 328 } | 329 } |
| 329 | 330 |
| 330 scoped_ptr<XmlElement> HeartbeatSender::CreateSignature() { | 331 scoped_ptr<XmlElement> HeartbeatSender::CreateSignature() { |
| 331 scoped_ptr<XmlElement> signature_tag(new XmlElement( | 332 scoped_ptr<XmlElement> signature_tag(new XmlElement( |
| 332 QName(kChromotingXmlNamespace, kHeartbeatSignatureTag))); | 333 QName(kChromotingXmlNamespace, kHeartbeatSignatureTag))); |
| 333 | 334 |
| 334 std::string message = signal_strategy_->GetLocalJid() + ' ' + | 335 std::string message = NormalizeJid(signal_strategy_->GetLocalJid()) + ' ' + |
| 335 base::IntToString(sequence_id_); | 336 base::IntToString(sequence_id_); |
| 336 std::string signature(host_key_pair_->SignMessage(message)); | 337 std::string signature(host_key_pair_->SignMessage(message)); |
| 337 signature_tag->AddText(signature); | 338 signature_tag->AddText(signature); |
| 338 | 339 |
| 339 return signature_tag.Pass(); | 340 return signature_tag.Pass(); |
| 340 } | 341 } |
| 341 | 342 |
| 342 } // namespace remoting | 343 } // namespace remoting |
| OLD | NEW |