summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-09 12:11:18 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-09 12:11:18 +0000
commit328e727855455626095ee8891fd09557a0ea6962 (patch)
tree849ba3522f75219cadab7868d7bfd9538e71a065
parent2c7e41c4d957203f5507256b30e0283ab80bcbbb (diff)
downloadchromium_src-328e727855455626095ee8891fd09557a0ea6962.zip
chromium_src-328e727855455626095ee8891fd09557a0ea6962.tar.gz
chromium_src-328e727855455626095ee8891fd09557a0ea6962.tar.bz2
On Windows, completely disable use of bind() with pseudo-random port selection.
I'll land this on the tip-of-tree, and then revert it. We'll then apply it to the dev branch so that there is no chance of accidentally getting security dialogs on Windows. This should reduce the bug to P2, and allow a more complete resolution of the bug. r=rch BUG=329255 Review URL: https://codereview.chromium.org/127463003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243858 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--net/quic/quic_stream_factory.cc12
-rw-r--r--net/quic/quic_stream_factory_test.cc5
2 files changed, 16 insertions, 1 deletions
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index a31b5cb..5161d77 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -514,9 +514,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;
+#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);
@@ -524,7 +529,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
// 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
diff --git a/net/quic/quic_stream_factory_test.cc b/net/quic/quic_stream_factory_test.cc
index 8f3bdde..e2ca257 100644
--- a/net/quic/quic_stream_factory_test.cc
+++ b/net/quic/quic_stream_factory_test.cc
@@ -576,6 +576,11 @@ TEST_P(QuicStreamFactoryTest, CancelCreate) {
}
TEST_P(QuicStreamFactoryTest, CreateConsistentEphemeralPort) {
+#if defined(OS_WIN)
+ // TODO(jar)bug=329255 Provide better implementation to avoid pop-up warning.
+ return;
+#endif
+
// Sequentially connect to the default host, then another host, and then the
// default host. Verify that the default host gets a consistent ephemeral
// port, that is different from the other host's connection.