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

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: Created 5 years, 10 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..37e4f9089b5a49442aacf1530ebb950ac2fc73f6 100644
--- a/content/browser/renderer_host/p2p/socket_host_udp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_udp.cc
@@ -109,6 +109,19 @@ bool P2PSocketHostUdp::Init(const net::IPEndPoint& local_address,
const P2PHostAndIPEndPoint& remote_address) {
DCHECK_EQ(state_, STATE_UNINITIALIZED);
+#if defined(OS_WIN)
+ // If configured for finch experiment, use nonblocking IO.
+ unsigned int use_nonblocking_io = 0;
+
+ base::StringToUint(
+ base::FieldTrialList::FindFullName(
+ "WebRTC-UDPServerSocketAsync"),
+ &use_nonblocking_io);
+ if (use_nonblocking_io > 0) {
guoweis_left_chromium 2015/03/03 17:43:39 Instead of using 0 to stand for disabled, could we
John L. Miller 2015/03/23 14:11:27 Done.
+ _socket::UseNonBlockingIO();
+ }
+#endif
+
int result = socket_->Listen(local_address);
if (result < 0) {
LOG(ERROR) << "bind() failed: " << result;
« 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