OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/signaling/xmpp_signal_strategy.h" | 5 #include "remoting/signaling/xmpp_signal_strategy.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 xmpp_server_config_(xmpp_server_config), | 157 xmpp_server_config_(xmpp_server_config), |
158 keep_alive_timer_( | 158 keep_alive_timer_( |
159 FROM_HERE, | 159 FROM_HERE, |
160 base::TimeDelta::FromSeconds(kKeepAliveIntervalSeconds), | 160 base::TimeDelta::FromSeconds(kKeepAliveIntervalSeconds), |
161 base::Bind(&Core::SendKeepAlive, base::Unretained(this)), | 161 base::Bind(&Core::SendKeepAlive, base::Unretained(this)), |
162 true) { | 162 true) { |
163 #if defined(NDEBUG) | 163 #if defined(NDEBUG) |
164 // Non-secure connections are allowed only for debugging. | 164 // Non-secure connections are allowed only for debugging. |
165 CHECK(xmpp_server_config_.use_tls); | 165 CHECK(xmpp_server_config_.use_tls); |
166 #endif | 166 #endif |
167 thread_checker_.DetachFromThread(); | |
Sergey Ulanov
2016/10/05 21:49:07
I don't think it's safe to detach from the thread
Sergey Ulanov
2016/10/05 21:49:07
Please add a comment xmpp_signal_strategy.h to mak
kelvinp
2016/10/06 00:43:06
Done.
kelvinp
2016/10/06 00:43:06
Done.
| |
167 } | 168 } |
168 | 169 |
169 XmppSignalStrategy::Core::~Core() { | 170 XmppSignalStrategy::Core::~Core() { |
170 Disconnect(); | 171 Disconnect(); |
171 } | 172 } |
172 | 173 |
173 void XmppSignalStrategy::Core::Connect() { | 174 void XmppSignalStrategy::Core::Connect() { |
174 DCHECK(thread_checker_.CalledOnValidThread()); | 175 DCHECK(thread_checker_.CalledOnValidThread()); |
175 | 176 |
176 // Disconnect first if we are currently connected. | 177 // Disconnect first if we are currently connected. |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
550 std::string XmppSignalStrategy::GetNextId() { | 551 std::string XmppSignalStrategy::GetNextId() { |
551 return base::Uint64ToString(base::RandUint64()); | 552 return base::Uint64ToString(base::RandUint64()); |
552 } | 553 } |
553 | 554 |
554 void XmppSignalStrategy::SetAuthInfo(const std::string& username, | 555 void XmppSignalStrategy::SetAuthInfo(const std::string& username, |
555 const std::string& auth_token) { | 556 const std::string& auth_token) { |
556 core_->SetAuthInfo(username, auth_token); | 557 core_->SetAuthInfo(username, auth_token); |
557 } | 558 } |
558 | 559 |
559 } // namespace remoting | 560 } // namespace remoting |
OLD | NEW |