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

Unified Diff: remoting/signaling/xmpp_signal_strategy.cc

Issue 2384063008: Enables delegating signal strategy for It2Me Host. (Closed)
Patch Set: Fix unit tests 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
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..5fff590794b281048fc325bf54cacb53a69b653b 100644
--- a/remoting/signaling/xmpp_signal_strategy.cc
+++ b/remoting/signaling/xmpp_signal_strategy.cc
@@ -155,15 +155,12 @@ XmppSignalStrategy::Core::Core(
: 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) {
+ keep_alive_timer_(true /* retain_user_task */, true /* is_repeating */) {
Sergey Ulanov 2016/10/06 18:28:57 Change keep_alive_timer_ to base::RepeatingTimer,
kelvinp 2016/10/06 20:30:28 Done.
#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 +184,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);
}
« remoting/signaling/delegating_signal_strategy.h ('K') | « remoting/signaling/xmpp_signal_strategy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698