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

Unified Diff: remoting/signaling/xmpp_signal_strategy.cc

Issue 2384063008: Enables delegating signal strategy for It2Me Host. (Closed)
Patch Set: Fix typos Created 4 years, 2 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/signaling/xmpp_signal_strategy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/signaling/xmpp_signal_strategy.cc
diff --git a/remoting/signaling/xmpp_signal_strategy.cc b/remoting/signaling/xmpp_signal_strategy.cc
index 46133761e1c44f34f7422e0cfbd35b86ec351c71..2dad2f71616a44104d95ab1d173ed4aa5c5bf736 100644
--- a/remoting/signaling/xmpp_signal_strategy.cc
+++ b/remoting/signaling/xmpp_signal_strategy.cc
@@ -141,7 +141,7 @@ class XmppSignalStrategy::Core : public XmppLoginHandler::Delegate {
base::ObserverList<Listener, true> listeners_;
- base::Timer keep_alive_timer_;
+ base::RepeatingTimer keep_alive_timer_;
base::ThreadChecker thread_checker_;
@@ -154,16 +154,12 @@ XmppSignalStrategy::Core::Core(
const XmppSignalStrategy::XmppServerConfig& xmpp_server_config)
: socket_factory_(socket_factory),
request_context_getter_(request_context_getter),
- xmpp_server_config_(xmpp_server_config),
- keep_alive_timer_(
- FROM_HERE,
- base::TimeDelta::FromSeconds(kKeepAliveIntervalSeconds),
- base::Bind(&Core::SendKeepAlive, base::Unretained(this)),
- true) {
+ xmpp_server_config_(xmpp_server_config) {
#if defined(NDEBUG)
// Non-secure connections are allowed only for debugging.
CHECK(xmpp_server_config_.use_tls);
#endif
+ thread_checker_.DetachFromThread();
}
XmppSignalStrategy::Core::~Core() {
@@ -187,6 +183,11 @@ void XmppSignalStrategy::Core::Connect() {
int result = socket_->Connect(base::Bind(
&Core::OnSocketConnected, base::Unretained(this)));
+
+ keep_alive_timer_.Start(
+ FROM_HERE, base::TimeDelta::FromSeconds(kKeepAliveIntervalSeconds),
+ base::Bind(&Core::SendKeepAlive, base::Unretained(this)));
+
if (result != net::ERR_IO_PENDING)
OnSocketConnected(result);
}
« no previous file with comments | « remoting/signaling/xmpp_signal_strategy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698