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 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/callback_helpers.h" | 11 #include "base/callback_helpers.h" |
12 #include "base/rand_util.h" | 12 #include "base/rand_util.h" |
13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
14 #include "base/strings/stringize_macros.h" | 14 #include "base/strings/stringize_macros.h" |
15 #include "base/threading/thread_task_runner_handle.h" | 15 #include "base/threading/thread_task_runner_handle.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 #include "remoting/base/constants.h" | 17 #include "remoting/base/constants.h" |
18 #include "remoting/base/logging.h" | 18 #include "remoting/base/logging.h" |
19 #include "remoting/host/host_details.h" | 19 #include "remoting/host/host_details.h" |
20 #include "remoting/host/server_log_entry_host.h" | 20 #include "remoting/host/server_log_entry_host.h" |
21 #include "remoting/signaling/iq_sender.h" | 21 #include "remoting/signaling/iq_sender.h" |
22 #include "remoting/signaling/jid_util.h" | |
23 #include "remoting/signaling/server_log_entry.h" | 22 #include "remoting/signaling/server_log_entry.h" |
24 #include "remoting/signaling/signal_strategy.h" | 23 #include "remoting/signaling/signal_strategy.h" |
| 24 #include "remoting/signaling/signaling_address.h" |
25 #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" | 25 #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" |
26 #include "third_party/libjingle_xmpp/xmpp/constants.h" | 26 #include "third_party/libjingle_xmpp/xmpp/constants.h" |
27 | 27 |
28 using buzz::QName; | 28 using buzz::QName; |
29 using buzz::XmlElement; | 29 using buzz::XmlElement; |
30 | 30 |
31 namespace remoting { | 31 namespace remoting { |
32 | 32 |
33 namespace { | 33 namespace { |
34 | 34 |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 AddHostFieldsToLogEntry(log_entry.get()); | 342 AddHostFieldsToLogEntry(log_entry.get()); |
343 log->AddElement(log_entry->ToStanza().release()); | 343 log->AddElement(log_entry->ToStanza().release()); |
344 heartbeat->AddElement(log.release()); | 344 heartbeat->AddElement(log.release()); |
345 return heartbeat; | 345 return heartbeat; |
346 } | 346 } |
347 | 347 |
348 std::unique_ptr<XmlElement> HeartbeatSender::CreateSignature() { | 348 std::unique_ptr<XmlElement> HeartbeatSender::CreateSignature() { |
349 std::unique_ptr<XmlElement> signature_tag( | 349 std::unique_ptr<XmlElement> signature_tag( |
350 new XmlElement(QName(kChromotingXmlNamespace, kHeartbeatSignatureTag))); | 350 new XmlElement(QName(kChromotingXmlNamespace, kHeartbeatSignatureTag))); |
351 | 351 |
352 std::string message = NormalizeJid(signal_strategy_->GetLocalJid()) + ' ' + | 352 std::string message = signal_strategy_->GetLocalAddress().jid() + ' ' + |
353 base::IntToString(sequence_id_); | 353 base::IntToString(sequence_id_); |
354 std::string signature(host_key_pair_->SignMessage(message)); | 354 std::string signature(host_key_pair_->SignMessage(message)); |
355 signature_tag->AddText(signature); | 355 signature_tag->AddText(signature); |
356 | 356 |
357 return signature_tag; | 357 return signature_tag; |
358 } | 358 } |
359 | 359 |
360 } // namespace remoting | 360 } // namespace remoting |
OLD | NEW |