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

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 experiment check 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..2882de91d5b24b68c4cf4c32a6684081e963dd2a 100644
--- a/content/browser/renderer_host/p2p/socket_host_udp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_udp.cc
@@ -68,17 +68,23 @@ P2PSocketHostUdp::PendingPacket::PendingPacket(
P2PSocketHostUdp::PendingPacket::~PendingPacket() {
}
-P2PSocketHostUdp::P2PSocketHostUdp(IPC::Sender* message_sender,
- int socket_id,
+P2PSocketHostUdp::P2PSocketHostUdp(IPC::Sender* message_sender, int socket_id,
Sergey Ulanov 2015/03/26 18:15:32 Formatting was correct here. One argument per line
John L. Miller 2015/03/26 18:23:10 Done.
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