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

Unified Diff: net/quic/quic_stream_factory.cc

Issue 1305293004: Notfiy NQE of QUIC RTT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated with more comments and tests Created 5 years, 3 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
Index: net/quic/quic_stream_factory.cc
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index d3bf9de857fb7449ab46be24987c93778e4938a2..356dd78e66db29a2cb7da2ae8116c7360b5f30d8 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -19,6 +19,8 @@
#include "base/thread_task_runner_handle.h"
#include "base/values.h"
#include "net/base/net_errors.h"
+#include "net/base/socket_performance_watcher.h"
+#include "net/base/socket_performance_watcher_factory.h"
#include "net/cert/cert_verifier.h"
#include "net/dns/host_resolver.h"
#include "net/dns/single_request_host_resolver.h"
@@ -558,6 +560,7 @@ QuicStreamFactory::QuicStreamFactory(
CertPolicyEnforcer* cert_policy_enforcer,
ChannelIDService* channel_id_service,
TransportSecurityState* transport_security_state,
+ const SocketPerformanceWatcherFactory* socket_performance_watcher_factory,
QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory,
QuicRandom* random_generator,
QuicClock* clock,
@@ -589,6 +592,7 @@ QuicStreamFactory::QuicStreamFactory(
random_generator_(random_generator),
clock_(clock),
max_packet_length_(max_packet_length),
+ socket_performance_watcher_factory_(socket_performance_watcher_factory),
config_(InitializeQuicConfig(connection_options)),
supported_versions_(supported_versions),
enable_port_selection_(enable_port_selection),
@@ -1225,10 +1229,18 @@ int QuicStreamFactory::CreateSession(const QuicServerId& server_id,
clock_.get(), random_generator_));
}
+ // Use the factory to create a new socket performance watcher, and pass the
+ // ownership to the QUIC connection.
+ scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher;
+ if (socket_performance_watcher_factory_) {
Ryan Hamilton 2015/09/10 19:32:04 When do we expect this to be null?
tbansal1 2015/09/11 19:38:35 incognito and some tests.
+ socket_performance_watcher = socket_performance_watcher_factory_
+ ->CreateUDPSocketPerformanceWatcher();
Ryan Hamilton 2015/09/10 19:32:04 Is this git cl format'd?
tbansal1 2015/09/11 19:38:35 Yes.
+ }
+
QuicConnection* connection = new QuicConnection(
connection_id, addr, helper_.get(), packet_writer_factory,
true /* owns_writer */, Perspective::IS_CLIENT, server_id.is_https(),
- supported_versions_);
+ supported_versions_, socket_performance_watcher.Pass());
connection->set_max_packet_length(max_packet_length_);
InitializeCachedStateInCryptoConfig(server_id, server_info);

Powered by Google App Engine
This is Rietveld 408576698