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

Unified Diff: net/quic/quic_stream_factory.cc

Issue 127463003: Completely disable use of bind() with pseudo-random port selection on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Let Windows tests ignore lack of use of bind() Created 6 years, 11 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 | net/quic/quic_stream_factory_test.cc » ('j') | net/quic/quic_stream_factory_test.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_stream_factory.cc
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index efa9fcab1f92e2b4a8d14ee80c633a6e0cccf3ab..d172885bec616d00189120a6c887ed35f856e356 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -511,9 +511,14 @@ int QuicStreamFactory::CreateSession(
IPEndPoint addr = *address_list.begin();
scoped_refptr<PortSuggester> port_suggester =
new PortSuggester(host_port_proxy_pair.first, port_seed_);
+ DatagramSocket::BindType bind_type = DatagramSocket::RANDOM_BIND;
+#if defined(OS_WIN)
+ // TODO(jar)bug=329255 Provide better implementation to avoid pop-up warning.
+ bind_type = DatagramSocket::DEFAULT_BIND;
Ryan Hamilton 2014/01/08 22:21:52 nit: i wonder if it would more symmetrical to do:
+#endif
scoped_ptr<DatagramClientSocket> socket(
client_socket_factory_->CreateDatagramClientSocket(
- DatagramSocket::RANDOM_BIND,
+ bind_type,
base::Bind(&PortSuggester::SuggestPort, port_suggester),
net_log.net_log(), net_log.source()));
int rv = socket->Connect(addr);
@@ -521,7 +526,12 @@ int QuicStreamFactory::CreateSession(
return rv;
UMA_HISTOGRAM_COUNTS("Net.QuicEphemeralPortsSuggested",
port_suggester->call_count());
+#if defined(OS_WIN)
+ // TODO(jar)bug=329255 Provide better implementation to avoid pop-up warning.
+ DCHECK_EQ(0u, port_suggester->call_count());
+#else
DCHECK_LE(1u, port_suggester->call_count());
+#endif
wtc 2014/01/08 22:36:05 I would just do // TODO(jar)bug=329255 Provide be
// We should adaptively set this buffer size, but for now, we'll use a size
// that is more than large enough for a full receive window, and yet
« no previous file with comments | « no previous file | net/quic/quic_stream_factory_test.cc » ('j') | net/quic/quic_stream_factory_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698