| 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" |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 QName(kChromotingXmlNamespace, kHostOperatingSystemVersionTag))); | 334 QName(kChromotingXmlNamespace, kHostOperatingSystemVersionTag))); |
| 335 os_version_tag->AddText(GetHostOperatingSystemVersion()); | 335 os_version_tag->AddText(GetHostOperatingSystemVersion()); |
| 336 heartbeat->AddElement(os_version_tag.release()); | 336 heartbeat->AddElement(os_version_tag.release()); |
| 337 } | 337 } |
| 338 // Append log message (which isn't signed). | 338 // Append log message (which isn't signed). |
| 339 scoped_ptr<XmlElement> log(ServerLogEntry::MakeStanza()); | 339 scoped_ptr<XmlElement> log(ServerLogEntry::MakeStanza()); |
| 340 scoped_ptr<ServerLogEntry> log_entry(MakeLogEntryForHeartbeat()); | 340 scoped_ptr<ServerLogEntry> log_entry(MakeLogEntryForHeartbeat()); |
| 341 AddHostFieldsToLogEntry(log_entry.get()); | 341 AddHostFieldsToLogEntry(log_entry.get()); |
| 342 log->AddElement(log_entry->ToStanza().release()); | 342 log->AddElement(log_entry->ToStanza().release()); |
| 343 heartbeat->AddElement(log.release()); | 343 heartbeat->AddElement(log.release()); |
| 344 return heartbeat.Pass(); | 344 return heartbeat; |
| 345 } | 345 } |
| 346 | 346 |
| 347 scoped_ptr<XmlElement> HeartbeatSender::CreateSignature() { | 347 scoped_ptr<XmlElement> HeartbeatSender::CreateSignature() { |
| 348 scoped_ptr<XmlElement> signature_tag(new XmlElement( | 348 scoped_ptr<XmlElement> signature_tag(new XmlElement( |
| 349 QName(kChromotingXmlNamespace, kHeartbeatSignatureTag))); | 349 QName(kChromotingXmlNamespace, kHeartbeatSignatureTag))); |
| 350 | 350 |
| 351 std::string message = NormalizeJid(signal_strategy_->GetLocalJid()) + ' ' + | 351 std::string message = NormalizeJid(signal_strategy_->GetLocalJid()) + ' ' + |
| 352 base::IntToString(sequence_id_); | 352 base::IntToString(sequence_id_); |
| 353 std::string signature(host_key_pair_->SignMessage(message)); | 353 std::string signature(host_key_pair_->SignMessage(message)); |
| 354 signature_tag->AddText(signature); | 354 signature_tag->AddText(signature); |
| 355 | 355 |
| 356 return signature_tag.Pass(); | 356 return signature_tag; |
| 357 } | 357 } |
| 358 | 358 |
| 359 } // namespace remoting | 359 } // namespace remoting |
| OLD | NEW |