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

Unified Diff: net/quic/quic_stream_factory.cc

Issue 968573002: Revert of Revert of Add a new enable_nonblocking_io field trial param for QUIC (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 | « net/quic/quic_stream_factory.h ('k') | net/quic/quic_stream_factory_test.cc » ('j') | no next file with comments »
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 bf8bd4df5731386c50a4cb66311edac1a9245e5a..092c48ca6f9caff6a1357980a558ad7b7b989f6d 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -37,6 +37,7 @@
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_server_id.h"
#include "net/socket/client_socket_factory.h"
+#include "net/udp/udp_client_socket.h"
#if defined(OS_WIN)
#include "base/win/windows_version.h"
@@ -597,6 +598,7 @@
float load_server_info_timeout_srtt_multiplier,
bool enable_truncated_connection_ids,
bool enable_connection_racing,
+ bool enable_non_blocking_io,
bool disable_disk_cache,
int socket_receive_buffer_size,
const QuicTagVector& connection_options)
@@ -621,6 +623,7 @@
load_server_info_timeout_srtt_multiplier),
enable_truncated_connection_ids_(enable_truncated_connection_ids),
enable_connection_racing_(enable_connection_racing),
+ enable_non_blocking_io_(enable_non_blocking_io),
disable_disk_cache_(disable_disk_cache),
socket_receive_buffer_size_(socket_receive_buffer_size),
port_seed_(random_generator_->RandUint64()),
@@ -1015,6 +1018,13 @@
base::Bind(&PortSuggester::SuggestPort, port_suggester),
net_log.net_log(), net_log.source()));
+ if (enable_non_blocking_io_ &&
+ client_socket_factory_ == ClientSocketFactory::GetDefaultFactory()) {
+#if defined(OS_WIN)
+ static_cast<UDPClientSocket*>(socket.get())->UseNonBlockingIO();
+#endif
+ }
+
// TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
tracked_objects::ScopedTracker tracking_profile2(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
« no previous file with comments | « net/quic/quic_stream_factory.h ('k') | net/quic/quic_stream_factory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698