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

Unified Diff: remoting/host/heartbeat_sender.h

Issue 2915193003: Add heartbeat timeout. (Closed)
Patch Set: 30 seconds Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/host/heartbeat_sender.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/heartbeat_sender.h
diff --git a/remoting/host/heartbeat_sender.h b/remoting/host/heartbeat_sender.h
index da5ef091802bab194f8577eef19fb989f0047c4f..3553a86f69517fae79a52e6245bce6fdec90236d 100644
--- a/remoting/host/heartbeat_sender.h
+++ b/remoting/host/heartbeat_sender.h
@@ -131,6 +131,7 @@ class HeartbeatSender : public SignalStrategy::Listener {
FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, ProcessResponseSetInterval);
FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest,
ProcessResponseExpectedSequenceId);
+ FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, ResponseTimeout);
friend class HeartbeatSenderTest;
void SendStanza();
@@ -139,7 +140,7 @@ class HeartbeatSender : public SignalStrategy::Listener {
void ProcessResponse(bool is_offline_heartbeat_response,
IqRequest* request,
const buzz::XmlElement* response);
- void SetInterval(int interval);
+ void SetInterval(base::TimeDelta interval);
void SetSequenceId(int sequence_id);
// Handlers for host-offline-reason completion and timeout.
@@ -158,14 +159,15 @@ class HeartbeatSender : public SignalStrategy::Listener {
std::string directory_bot_jid_;
std::unique_ptr<IqSender> iq_sender_;
std::unique_ptr<IqRequest> request_;
- int interval_ms_;
+ base::TimeDelta interval_;
base::RepeatingTimer timer_;
base::OneShotTimer timer_resend_;
- int sequence_id_;
- bool sequence_id_was_set_;
- int sequence_id_recent_set_num_;
- bool heartbeat_succeeded_;
- int failed_startup_heartbeat_count_;
+ int sequence_id_ = 0;
+ bool sequence_id_was_set_ = false;
+ int sequence_id_recent_set_num_ = 0;
+ bool heartbeat_succeeded_ = false;
+ int failed_startup_heartbeat_count_ = 0;
+ int timed_out_heartbeats_count_ = 0;
// Fields to send and indicate completion of sending host-offline-reason.
std::string host_offline_reason_;
« no previous file with comments | « no previous file | remoting/host/heartbeat_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698