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

Unified Diff: remoting/host/heartbeat_sender.cc

Issue 10106013: Chromoting: stopping the service if the host ID is permanently not recognized by the could. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feeback. Rebased. Created 8 years, 8 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 | « 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 e061accdfb7d6c5e90d8523ab804ae3d40e1ac6a..8420acf12c9f486a9ece4c30373fe1c582d5e74e 100644
--- a/remoting/host/heartbeat_sender.cc
+++ b/remoting/host/heartbeat_sender.cc
@@ -13,6 +13,7 @@
#include "base/string_number_conversions.h"
#include "base/time.h"
#include "remoting/base/constants.h"
+#include "remoting/host/constants.h"
#include "remoting/jingle_glue/iq_sender.h"
#include "remoting/jingle_glue/jingle_thread.h"
#include "remoting/jingle_glue/signal_strategy.h"
@@ -43,15 +44,15 @@ const int64 kResendDelayMs = 10 * 1000; // 10 seconds.
const int64 kResendDelayOnHostNotFoundMs = 10 * 1000; // 10 seconds.
const int kMaxResendOnHostNotFoundCount = 12; // 2 minutes (12 x 10 seconds).
-const int kExitCodeHostIdInvalid = 100;
-
} // namespace
HeartbeatSender::HeartbeatSender(
+ Listener* listener,
const std::string& host_id,
SignalStrategy* signal_strategy,
HostKeyPair* key_pair)
- : host_id_(host_id),
+ : listener_(listener),
+ host_id_(host_id),
signal_strategy_(signal_strategy),
key_pair_(key_pair),
interval_ms_(kDefaultHeartbeatIntervalMs),
@@ -134,11 +135,8 @@ void HeartbeatSender::ProcessResponse(IqRequest* request,
&HeartbeatSender::ResendStanza);
return;
}
- // TODO(lambroslambrou): Trigger an application-defined callback to
- // shut down the host properly, instead of just exiting here
- // (http://crbug.com/112160).
- LOG(ERROR) << "Exit: Host ID not found";
- exit(kExitCodeHostIdInvalid);
+ listener_->OnUnknownHostIdError();
+ return;
}
}
« 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