Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: remoting/host/heartbeat_sender.cc

Issue 1547473005: Switch to standard integer types in remoting/host/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/host/heartbeat_sender.h ('k') | remoting/host/host_change_notification_listener.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 9
9 #include "base/bind.h" 10 #include "base/bind.h"
10 #include "base/callback_helpers.h" 11 #include "base/callback_helpers.h"
11 #include "base/rand_util.h" 12 #include "base/rand_util.h"
12 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/stringize_macros.h" 14 #include "base/strings/stringize_macros.h"
14 #include "base/thread_task_runner_handle.h" 15 #include "base/thread_task_runner_handle.h"
15 #include "base/time/time.h" 16 #include "base/time/time.h"
16 #include "remoting/base/constants.h" 17 #include "remoting/base/constants.h"
17 #include "remoting/base/logging.h" 18 #include "remoting/base/logging.h"
(...skipping 22 matching lines...) Expand all
40 const char kHostOperatingSystemNameTag[] = "host-os-name"; 41 const char kHostOperatingSystemNameTag[] = "host-os-name";
41 const char kHostOperatingSystemVersionTag[] = "host-os-version"; 42 const char kHostOperatingSystemVersionTag[] = "host-os-version";
42 43
43 const char kErrorTag[] = "error"; 44 const char kErrorTag[] = "error";
44 const char kNotFoundTag[] = "item-not-found"; 45 const char kNotFoundTag[] = "item-not-found";
45 46
46 const char kHeartbeatResultTag[] = "heartbeat-result"; 47 const char kHeartbeatResultTag[] = "heartbeat-result";
47 const char kSetIntervalTag[] = "set-interval"; 48 const char kSetIntervalTag[] = "set-interval";
48 const char kExpectedSequenceIdTag[] = "expected-sequence-id"; 49 const char kExpectedSequenceIdTag[] = "expected-sequence-id";
49 50
50 const int64 kDefaultHeartbeatIntervalMs = 5 * 60 * 1000; // 5 minutes. 51 const int64_t kDefaultHeartbeatIntervalMs = 5 * 60 * 1000; // 5 minutes.
51 const int64 kResendDelayMs = 10 * 1000; // 10 seconds. 52 const int64_t kResendDelayMs = 10 * 1000; // 10 seconds.
52 const int64 kResendDelayOnHostNotFoundMs = 10 * 1000; // 10 seconds. 53 const int64_t kResendDelayOnHostNotFoundMs = 10 * 1000; // 10 seconds.
53 const int kMaxResendOnHostNotFoundCount = 12; // 2 minutes (12 x 10 seconds). 54 const int kMaxResendOnHostNotFoundCount = 12; // 2 minutes (12 x 10 seconds).
54 55
55 } // namespace 56 } // namespace
56 57
57 HeartbeatSender::HeartbeatSender( 58 HeartbeatSender::HeartbeatSender(
58 const base::Closure& on_heartbeat_successful_callback, 59 const base::Closure& on_heartbeat_successful_callback,
59 const base::Closure& on_unknown_host_id_error, 60 const base::Closure& on_unknown_host_id_error,
60 const std::string& host_id, 61 const std::string& host_id,
61 SignalStrategy* signal_strategy, 62 SignalStrategy* signal_strategy,
62 const scoped_refptr<const RsaKeyPair>& host_key_pair, 63 const scoped_refptr<const RsaKeyPair>& host_key_pair,
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 351
351 std::string message = NormalizeJid(signal_strategy_->GetLocalJid()) + ' ' + 352 std::string message = NormalizeJid(signal_strategy_->GetLocalJid()) + ' ' +
352 base::IntToString(sequence_id_); 353 base::IntToString(sequence_id_);
353 std::string signature(host_key_pair_->SignMessage(message)); 354 std::string signature(host_key_pair_->SignMessage(message));
354 signature_tag->AddText(signature); 355 signature_tag->AddText(signature);
355 356
356 return signature_tag.Pass(); 357 return signature_tag.Pass();
357 } 358 }
358 359
359 } // namespace remoting 360 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/heartbeat_sender.h ('k') | remoting/host/host_change_notification_listener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698