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

Unified Diff: remoting/host/heartbeat_sender.cc

Issue 734053003: Reporting of policy errors via host-offline-reason: part 2b (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hor-nohoststatussender
Patch Set: Rebasing... Created 6 years, 1 month 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 | « remoting/host/heartbeat_sender.h ('k') | remoting/host/heartbeat_sender_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/heartbeat_sender.cc
diff --git a/remoting/host/heartbeat_sender.cc b/remoting/host/heartbeat_sender.cc
index 2be0485ab6276757187ceb3157fefe9358150bab..c64f2f49cf1c6b536afa13481ebde83f6dea8882 100644
--- a/remoting/host/heartbeat_sender.cc
+++ b/remoting/host/heartbeat_sender.cc
@@ -50,12 +50,14 @@ const int kMaxResendOnHostNotFoundCount = 12; // 2 minutes (12 x 10 seconds).
} // namespace
HeartbeatSender::HeartbeatSender(
- Listener* listener,
+ const base::Closure& on_heartbeat_successful_callback,
+ const base::Closure& on_unknown_host_id_error,
const std::string& host_id,
SignalStrategy* signal_strategy,
scoped_refptr<RsaKeyPair> key_pair,
const std::string& directory_bot_jid)
- : listener_(listener),
+ : on_heartbeat_successful_callback_(on_heartbeat_successful_callback),
+ on_unknown_host_id_error_(on_unknown_host_id_error),
host_id_(host_id),
signal_strategy_(signal_strategy),
key_pair_(key_pair),
@@ -167,7 +169,7 @@ void HeartbeatSender::ProcessResponse(
&HeartbeatSender::ResendStanza);
return;
}
- listener_->OnUnknownHostIdError();
+ on_unknown_host_id_error_.Run();
return;
}
}
@@ -222,7 +224,7 @@ void HeartbeatSender::ProcessResponse(
// Notify listener of the first successful heartbeat.
if (!heartbeat_succeeded_) {
- listener_->OnHeartbeatSuccessful();
+ on_heartbeat_successful_callback_.Run();
}
heartbeat_succeeded_ = true;
« no previous file with comments | « remoting/host/heartbeat_sender.h ('k') | remoting/host/heartbeat_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698