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

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: Set UDP server port async for experiment. 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..1548f1508ad3ec755fd89c208e4499485b6b0ae5 100644
--- a/content/browser/renderer_host/p2p/socket_host_udp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_udp.cc
@@ -109,6 +109,14 @@ 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.
+ if (base::FieldTrialList::FindFullName("WebRTC-UDPServerSocketAsync") ==
Sergey Ulanov 2015/03/13 18:28:51 This is not a good name for the experiment: overla
John L. Miller 2015/03/23 14:11:27 Done.
John L. Miller 2015/03/23 14:11:28 Done.
+ "Enabled") {
+ static_cast<UdpServerSocket *>(socket_.get())->UseNonBlockingIO();
Sergey Ulanov 2015/03/13 18:28:51 You can avoid upcast if you put this in the constr
John L. Miller 2015/03/23 14:11:28 I'm nervous about changing the type when socket_ i
Sergey Ulanov 2015/03/25 17:50:28 I wasn't suggesting to change type of |socket_|. I
+ }
+#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