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

Unified Diff: content/browser/renderer_host/p2p/socket_host_udp.cc

Issue 972203002: Support finch experiment WebRTC-UDPServerSocketAsync for Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move UDP socket experimental config to constructor. Created 5 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/p2p/socket_host_udp.cc
diff --git a/content/browser/renderer_host/p2p/socket_host_udp.cc b/content/browser/renderer_host/p2p/socket_host_udp.cc
index fd09f7d30534e890287c0e9ee94c614813199351..b67fd55ed0f6ca81d9be2818c4edad294c963b2b 100644
--- a/content/browser/renderer_host/p2p/socket_host_udp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_udp.cc
@@ -72,13 +72,20 @@ P2PSocketHostUdp::P2PSocketHostUdp(IPC::Sender* message_sender,
int socket_id,
P2PMessageThrottler* throttler)
: P2PSocketHost(message_sender, socket_id, P2PSocketHost::UDP),
- socket_(
- new net::UDPServerSocket(GetContentClient()->browser()->GetNetLog(),
- net::NetLog::Source())),
send_pending_(false),
last_dscp_(net::DSCP_CS0),
throttler_(throttler),
send_buffer_size_(0) {
+ net::UDPServerSocket* socket = new net::UDPServerSocket(
+ GetContentClient()->browser()->GetNetLog(), net::NetLog::Source());
+#if defined(OS_WIN)
+ // If configured for finch experiment, use nonblocking IO.
+ if (base::FieldTrialList::FindFullName("WebRTC-UDPSocketNonBlockingIO") ==
+ "Enabled") {
+ socket->UseNonBlockingIO();
+ }
+#endif
+ socket_.reset(socket);
}
P2PSocketHostUdp::~P2PSocketHostUdp() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698