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

Unified Diff: webrtc/p2p/base/testturnserver.h

Issue 2141863003: Adding an end-to-end connection time test. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Merge with master. Created 4 years, 3 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 | « webrtc/base/fakenetwork.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/testturnserver.h
diff --git a/webrtc/p2p/base/testturnserver.h b/webrtc/p2p/base/testturnserver.h
index 43d363cb35b41aeae09245b7c2a474cad77b43b6..9cd8203762b8ebae95ce276d23ad7190b14c7be6 100644
--- a/webrtc/p2p/base/testturnserver.h
+++ b/webrtc/p2p/base/testturnserver.h
@@ -52,10 +52,10 @@ class TestTurnServer : public TurnAuthInterface {
const rtc::SocketAddress& int_addr,
const rtc::SocketAddress& udp_ext_addr,
ProtocolType int_protocol = PROTO_UDP)
- : server_(thread) {
+ : server_(thread), thread_(thread) {
AddInternalSocket(int_addr, int_protocol);
- server_.SetExternalSocketFactory(new rtc::BasicPacketSocketFactory(),
- udp_ext_addr);
+ server_.SetExternalSocketFactory(new rtc::BasicPacketSocketFactory(thread),
+ udp_ext_addr);
server_.set_realm(kTestRealm);
server_.set_software(kTestSoftware);
server_.set_auth_hook(this);
@@ -77,15 +77,15 @@ class TestTurnServer : public TurnAuthInterface {
void AddInternalSocket(const rtc::SocketAddress& int_addr,
ProtocolType proto) {
- rtc::Thread* thread = rtc::Thread::Current();
if (proto == cricket::PROTO_UDP) {
- server_.AddInternalSocket(rtc::AsyncUDPSocket::Create(
- thread->socketserver(), int_addr), proto);
+ server_.AddInternalSocket(
+ rtc::AsyncUDPSocket::Create(thread_->socketserver(), int_addr),
+ proto);
} else if (proto == cricket::PROTO_TCP) {
// For TCP we need to create a server socket which can listen for incoming
// new connections.
rtc::AsyncSocket* socket =
- thread->socketserver()->CreateAsyncSocket(SOCK_STREAM);
+ thread_->socketserver()->CreateAsyncSocket(SOCK_STREAM);
socket->Bind(int_addr);
socket->Listen(5);
server_.AddInternalServerSocket(socket, proto);
@@ -114,6 +114,7 @@ class TestTurnServer : public TurnAuthInterface {
}
TurnServer server_;
+ rtc::Thread* thread_;
};
} // namespace cricket
« no previous file with comments | « webrtc/base/fakenetwork.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698