summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/http/http_network_session.cc1
-rw-r--r--net/quic/quic_chromium_client_session.cc6
-rw-r--r--net/quic/quic_chromium_client_session.h2
-rw-r--r--net/quic/quic_chromium_client_session_test.cc2
-rw-r--r--net/quic/quic_connection.cc2
-rw-r--r--net/quic/quic_connection.h4
-rw-r--r--net/quic/quic_connection_logger.cc17
-rw-r--r--net/quic/quic_connection_logger.h13
-rw-r--r--net/quic/quic_connection_logger_unittest.cc6
-rw-r--r--net/quic/quic_http_stream_test.cc4
-rw-r--r--net/quic/quic_network_transaction_unittest.cc100
-rw-r--r--net/quic/quic_stream_factory.cc15
-rw-r--r--net/quic/quic_stream_factory.h7
-rw-r--r--net/quic/quic_stream_factory_test.cc1
14 files changed, 163 insertions, 17 deletions
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc
index 3319bf1..4c0009c 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -145,6 +145,7 @@ HttpNetworkSession::HttpNetworkSession(const Params& params)
params.cert_policy_enforcer,
params.channel_id_service,
params.transport_security_state,
+ params.socket_performance_watcher_factory,
params.quic_crypto_client_stream_factory,
params.quic_random ? params.quic_random : QuicRandom::GetInstance(),
params.quic_clock ? params.quic_clock : new QuicClock(),
diff --git a/net/quic/quic_chromium_client_session.cc b/net/quic/quic_chromium_client_session.cc
index c8a1de6..85a1ca4 100644
--- a/net/quic/quic_chromium_client_session.cc
+++ b/net/quic/quic_chromium_client_session.cc
@@ -170,6 +170,7 @@ QuicChromiumClientSession::QuicChromiumClientSession(
const char* const connection_description,
base::TimeTicks dns_resolution_end_time,
base::TaskRunner* task_runner,
+ scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher,
NetLog* net_log)
: QuicClientSessionBase(connection, config),
server_id_(server_id),
@@ -183,7 +184,10 @@ QuicChromiumClientSession::QuicChromiumClientSession(
net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_QUIC_SESSION)),
packet_reader_(socket_.get(), this, net_log_),
dns_resolution_end_time_(dns_resolution_end_time),
- logger_(new QuicConnectionLogger(this, connection_description, net_log_)),
+ logger_(new QuicConnectionLogger(this,
+ connection_description,
+ socket_performance_watcher.Pass(),
+ net_log_)),
going_away_(false),
disabled_reason_(QUIC_DISABLED_NOT),
weak_factory_(this) {
diff --git a/net/quic/quic_chromium_client_session.h b/net/quic/quic_chromium_client_session.h
index feb0710..81d3c17 100644
--- a/net/quic/quic_chromium_client_session.h
+++ b/net/quic/quic_chromium_client_session.h
@@ -17,6 +17,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
#include "net/base/completion_callback.h"
+#include "net/base/socket_performance_watcher.h"
#include "net/proxy/proxy_server.h"
#include "net/quic/quic_client_session_base.h"
#include "net/quic/quic_connection_logger.h"
@@ -119,6 +120,7 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession
const char* const connection_description,
base::TimeTicks dns_resolution_end_time,
base::TaskRunner* task_runner,
+ scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher,
NetLog* net_log);
~QuicChromiumClientSession() override;
diff --git a/net/quic/quic_chromium_client_session_test.cc b/net/quic/quic_chromium_client_session_test.cc
index 91d1d1a..dee5e74dd 100644
--- a/net/quic/quic_chromium_client_session_test.cc
+++ b/net/quic/quic_chromium_client_session_test.cc
@@ -10,6 +10,7 @@
#include "base/files/file_path.h"
#include "base/rand_util.h"
#include "base/thread_task_runner_handle.h"
+#include "net/base/socket_performance_watcher.h"
#include "net/base/test_completion_callback.h"
#include "net/base/test_data_directory.h"
#include "net/cert/cert_verify_result.h"
@@ -62,6 +63,7 @@ class QuicChromiumClientSessionTest
"CONNECTION_UNKNOWN",
base::TimeTicks::Now(),
base::ThreadTaskRunnerHandle::Get().get(),
+ /*socket_performance_watcher=*/nullptr,
&net_log_) {
session_.Initialize();
// Advance the time, because timers do not like uninitialized times.
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index 97895bd..ac6629e 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -1697,6 +1697,8 @@ void QuicConnection::OnRttChange() {
rtt = QuicTime::Delta::FromMicroseconds(
sent_packet_manager_.GetRttStats()->initial_rtt_us());
}
+ if (debug_visitor_)
+ debug_visitor_->OnRttChanged(rtt);
packet_generator_.OnRttChange(rtt);
}
diff --git a/net/quic/quic_connection.h b/net/quic/quic_connection.h
index 8cf3227..1d7715e 100644
--- a/net/quic/quic_connection.h
+++ b/net/quic/quic_connection.h
@@ -243,6 +243,10 @@ class NET_EXPORT_PRIVATE QuicConnectionDebugVisitor
// Called when resuming previous connection state.
virtual void OnResumeConnectionState(
const CachedNetworkParameters& cached_network_params) {}
+
+ // Called when RTT may have changed, including when an RTT is read from
+ // the config.
+ virtual void OnRttChanged(QuicTime::Delta rtt) const {}
};
class NET_EXPORT_PRIVATE QuicConnectionHelperInterface {
diff --git a/net/quic/quic_connection_logger.cc b/net/quic/quic_connection_logger.cc
index 54b6cd4..47620ac 100644
--- a/net/quic/quic_connection_logger.cc
+++ b/net/quic/quic_connection_logger.cc
@@ -22,6 +22,7 @@
#include "net/quic/crypto/crypto_protocol.h"
#include "net/quic/quic_address_mismatch.h"
#include "net/quic/quic_socket_address_coder.h"
+#include "net/quic/quic_time.h"
using base::StringPiece;
using std::string;
@@ -286,6 +287,7 @@ AddressFamily GetRealAddressFamily(const IPAddressNumber& address) {
QuicConnectionLogger::QuicConnectionLogger(
QuicSpdySession* session,
const char* const connection_description,
+ scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher,
const BoundNetLog& net_log)
: net_log_(net_log),
session_(session),
@@ -307,7 +309,8 @@ QuicConnectionLogger::QuicConnectionLogger(
num_duplicate_packets_(0),
num_blocked_frames_received_(0),
num_blocked_frames_sent_(0),
- connection_description_(connection_description) {}
+ connection_description_(connection_description),
+ socket_performance_watcher_(socket_performance_watcher.Pass()) {}
QuicConnectionLogger::~QuicConnectionLogger() {
UMA_HISTOGRAM_COUNTS("Net.QuicSession.OutOfOrderPacketsReceived",
@@ -797,6 +800,18 @@ float QuicConnectionLogger::ReceivedPacketLossRate() const {
return num_received / largest_received_packet_number_;
}
+void QuicConnectionLogger::OnRttChanged(QuicTime::Delta rtt) const {
+ // Notify socket performance watcher of the updated RTT value.
+ if (!socket_performance_watcher_)
+ return;
+
+ int64_t microseconds = rtt.ToMicroseconds();
+ if (microseconds != 0) {
+ socket_performance_watcher_->OnUpdatedRTTAvailable(
+ base::TimeDelta::FromMicroseconds(rtt.ToMicroseconds()));
+ }
+}
+
void QuicConnectionLogger::RecordAggregatePacketLossRate() const {
// For short connections under 22 packets in length, we'll rely on the
// Net.QuicSession.21CumulativePacketsReceived_* histogram to indicate packet
diff --git a/net/quic/quic_connection_logger.h b/net/quic/quic_connection_logger.h
index 55e0566..9e687f2 100644
--- a/net/quic/quic_connection_logger.h
+++ b/net/quic/quic_connection_logger.h
@@ -9,6 +9,7 @@
#include "net/base/ip_endpoint.h"
#include "net/base/network_change_notifier.h"
+#include "net/base/socket_performance_watcher.h"
#include "net/log/net_log.h"
#include "net/quic/quic_connection.h"
#include "net/quic/quic_protocol.h"
@@ -27,9 +28,11 @@ class CertVerifyResult;
class NET_EXPORT_PRIVATE QuicConnectionLogger
: public QuicConnectionDebugVisitor {
public:
- QuicConnectionLogger(QuicSpdySession* session,
- const char* const connection_description,
- const BoundNetLog& net_log);
+ QuicConnectionLogger(
+ QuicSpdySession* session,
+ const char* const connection_description,
+ scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher,
+ const BoundNetLog& net_log);
~QuicConnectionLogger() override;
@@ -68,6 +71,7 @@ class NET_EXPORT_PRIVATE QuicConnectionLogger
base::StringPiece payload) override;
void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
void OnSuccessfulVersionNegotiation(const QuicVersion& version) override;
+ void OnRttChanged(QuicTime::Delta rtt) const override;
void OnCryptoHandshakeMessageReceived(
const CryptoHandshakeMessage& message);
@@ -179,6 +183,9 @@ class NET_EXPORT_PRIVATE QuicConnectionLogger
// The available type of connection (WiFi, 3G, etc.) when connection was first
// used.
const char* const connection_description_;
+ // Receives notifications regarding the performance of the underlying socket
+ // for the QUIC connection. May be null.
+ const scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher_;
DISALLOW_COPY_AND_ASSIGN(QuicConnectionLogger);
};
diff --git a/net/quic/quic_connection_logger_unittest.cc b/net/quic/quic_connection_logger_unittest.cc
index fd0fc3e..3d66f3f 100644
--- a/net/quic/quic_connection_logger_unittest.cc
+++ b/net/quic/quic_connection_logger_unittest.cc
@@ -4,6 +4,7 @@
#include "net/quic/quic_connection_logger.h"
+#include "net/base/socket_performance_watcher.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/test_tools/quic_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -32,7 +33,10 @@ class QuicConnectionLoggerTest : public ::testing::Test {
protected:
QuicConnectionLoggerTest()
: session_(new MockConnection(Perspective::IS_CLIENT)),
- logger_(&session_, "CONNECTION_UNKNOWN", net_log_) {}
+ logger_(&session_,
+ "CONNECTION_UNKNOWN",
+ /*socket_performance_watcher=*/nullptr,
+ net_log_) {}
BoundNetLog net_log_;
MockQuicSpdySession session_;
diff --git a/net/quic/quic_http_stream_test.cc b/net/quic/quic_http_stream_test.cc
index 91d5719..40639de 100644
--- a/net/quic/quic_http_stream_test.cc
+++ b/net/quic/quic_http_stream_test.cc
@@ -12,6 +12,7 @@
#include "net/base/chunked_upload_data_stream.h"
#include "net/base/elements_upload_data_stream.h"
#include "net/base/net_errors.h"
+#include "net/base/socket_performance_watcher.h"
#include "net/base/test_completion_callback.h"
#include "net/base/upload_bytes_element_reader.h"
#include "net/http/http_response_headers.h"
@@ -222,7 +223,8 @@ class QuicHttpStreamTest : public ::testing::TestWithParam<QuicVersion> {
/*is_secure=*/false, PRIVACY_MODE_DISABLED),
/*cert_verify_flags=*/0, DefaultQuicConfig(), &crypto_config_,
"CONNECTION_UNKNOWN", base::TimeTicks::Now(),
- base::ThreadTaskRunnerHandle::Get().get(), nullptr));
+ base::ThreadTaskRunnerHandle::Get().get(),
+ /*socket_performance_watcher=*/nullptr, nullptr));
session_->Initialize();
session_->GetCryptoStream()->CryptoConnect();
EXPECT_TRUE(session_->IsCryptoHandshakeConfirmed());
diff --git a/net/quic/quic_network_transaction_unittest.cc b/net/quic/quic_network_transaction_unittest.cc
index b0b5de2..1bac0f4 100644
--- a/net/quic/quic_network_transaction_unittest.cc
+++ b/net/quic/quic_network_transaction_unittest.cc
@@ -8,6 +8,8 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
+#include "net/base/network_quality_estimator.h"
+#include "net/base/socket_performance_watcher.h"
#include "net/base/test_completion_callback.h"
#include "net/base/test_data_directory.h"
#include "net/cert/mock_cert_verifier.h"
@@ -139,6 +141,61 @@ class ProxyHeadersHandler {
bool was_called_;
};
+class TestSocketPerformanceWatcher : public SocketPerformanceWatcher {
+ public:
+ TestSocketPerformanceWatcher()
+ : received_updated_rtt_available_notification_(false) {}
+
+ ~TestSocketPerformanceWatcher() override {}
+
+ void OnUpdatedRTTAvailable(const base::TimeDelta& rtt) override {
+ received_updated_rtt_available_notification_ = true;
+ }
+
+ bool received_updated_rtt_available_notification() const {
+ return received_updated_rtt_available_notification_;
+ }
+
+ private:
+ bool received_updated_rtt_available_notification_;
+ DISALLOW_COPY_AND_ASSIGN(TestSocketPerformanceWatcher);
+};
+
+class TestNetworkQualityEstimator : public NetworkQualityEstimator {
+ public:
+ TestNetworkQualityEstimator()
+ : NetworkQualityEstimator(scoped_ptr<net::ExternalEstimateProvider>(),
+ std::map<std::string, std::string>()) {}
+
+ ~TestNetworkQualityEstimator() override {}
+
+ scoped_ptr<SocketPerformanceWatcher> CreateUDPSocketPerformanceWatcher()
+ const override {
+ TestSocketPerformanceWatcher* watcher = new TestSocketPerformanceWatcher();
+ watchers_.push_back(watcher);
+ return scoped_ptr<TestSocketPerformanceWatcher>(watcher);
+ }
+
+ scoped_ptr<SocketPerformanceWatcher> CreateTCPSocketPerformanceWatcher()
+ const override {
+ NOTIMPLEMENTED();
+ return nullptr;
+ }
+
+ bool IsRTTAvailableNotificationReceived() const {
+ for (const auto& watcher : watchers_)
+ if (watcher->received_updated_rtt_available_notification())
+ return true;
+ return false;
+ }
+
+ size_t GetWatchersCreated() const { return watchers_.size(); }
+
+ private:
+ mutable std::vector<TestSocketPerformanceWatcher*> watchers_;
+ DISALLOW_COPY_AND_ASSIGN(TestNetworkQualityEstimator);
+};
+
class QuicNetworkTransactionTest
: public PlatformTest,
public ::testing::WithParamInterface<QuicVersion> {
@@ -146,6 +203,7 @@ class QuicNetworkTransactionTest
QuicNetworkTransactionTest()
: clock_(new MockClock),
maker_(GetParam(), 0, clock_, kDefaultServerHostName),
+ test_network_quality_estimator_(new TestNetworkQualityEstimator()),
ssl_config_service_(new SSLConfigServiceDefaults),
proxy_service_(ProxyService::CreateDirect()),
auth_handler_factory_(
@@ -248,6 +306,8 @@ class QuicNetworkTransactionTest
params_.host_resolver = &host_resolver_;
params_.cert_verifier = &cert_verifier_;
params_.transport_security_state = &transport_security_state_;
+ params_.socket_performance_watcher_factory =
+ test_network_quality_estimator_.get();
params_.proxy_service = proxy_service_.get();
params_.ssl_config_service = ssl_config_service_.get();
params_.http_auth_handler_factory = auth_handler_factory_.get();
@@ -372,6 +432,7 @@ class QuicNetworkTransactionTest
MockHostResolver host_resolver_;
MockCertVerifier cert_verifier_;
TransportSecurityState transport_security_state_;
+ scoped_ptr<TestNetworkQualityEstimator> test_network_quality_estimator_;
scoped_refptr<SSLConfigServiceDefaults> ssl_config_service_;
scoped_ptr<ProxyService> proxy_service_;
scoped_ptr<HttpAuthHandlerFactory> auth_handler_factory_;
@@ -430,7 +491,11 @@ TEST_P(QuicNetworkTransactionTest, ForceQuic) {
CreateSession();
+ EXPECT_FALSE(
+ test_network_quality_estimator_->IsRTTAvailableNotificationReceived());
SendRequestAndExpectQuicResponse("hello!");
+ EXPECT_TRUE(
+ test_network_quality_estimator_->IsRTTAvailableNotificationReceived());
// Check that the NetLog was filled reasonably.
TestNetLogEntry::List entries;
@@ -491,12 +556,16 @@ TEST_P(QuicNetworkTransactionTest, QuicProxy) {
mock_quic_data.AddSocketDataToFactory(&socket_factory_);
+ EXPECT_FALSE(
+ test_network_quality_estimator_->IsRTTAvailableNotificationReceived());
// There is no need to set up an alternate protocol job, because
// no attempt will be made to speak to the proxy over TCP.
CreateSession();
SendRequestAndExpectQuicResponseFromProxyOnPort("hello!", 70);
+ EXPECT_TRUE(
+ test_network_quality_estimator_->IsRTTAvailableNotificationReceived());
}
// Regression test for https://crbug.com/492458. Test that for an HTTP
@@ -548,19 +617,27 @@ TEST_P(QuicNetworkTransactionTest, ForceQuicWithErrorConnecting) {
params_.origin_to_force_quic_on =
HostPortPair::FromString("www.google.com:80");
- MockQuicData mock_quic_data;
- mock_quic_data.AddRead(ASYNC, ERR_SOCKET_NOT_CONNECTED);
+ MockQuicData mock_quic_data1;
+ mock_quic_data1.AddRead(ASYNC, ERR_SOCKET_NOT_CONNECTED);
- mock_quic_data.AddSocketDataToFactory(&socket_factory_);
+ MockQuicData mock_quic_data2;
+ mock_quic_data2.AddRead(ASYNC, ERR_SOCKET_NOT_CONNECTED);
+
+ mock_quic_data1.AddSocketDataToFactory(&socket_factory_);
+ mock_quic_data2.AddSocketDataToFactory(&socket_factory_);
CreateSession();
- scoped_ptr<HttpNetworkTransaction> trans(
- new HttpNetworkTransaction(DEFAULT_PRIORITY, session_.get()));
- TestCompletionCallback callback;
- int rv = trans->Start(&request_, callback.callback(), net_log_.bound());
- EXPECT_EQ(ERR_IO_PENDING, rv);
- EXPECT_EQ(ERR_CONNECTION_CLOSED, callback.WaitForResult());
+ EXPECT_EQ(0U, test_network_quality_estimator_->GetWatchersCreated());
+ for (size_t i = 0; i < 2; ++i) {
+ scoped_ptr<HttpNetworkTransaction> trans(
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session_.get()));
+ TestCompletionCallback callback;
+ int rv = trans->Start(&request_, callback.callback(), net_log_.bound());
+ EXPECT_EQ(ERR_IO_PENDING, rv);
+ EXPECT_EQ(ERR_CONNECTION_CLOSED, callback.WaitForResult());
+ EXPECT_EQ(1 + i, test_network_quality_estimator_->GetWatchersCreated());
+ }
}
TEST_P(QuicNetworkTransactionTest, DoNotForceQuicForHttps) {
@@ -583,6 +660,7 @@ TEST_P(QuicNetworkTransactionTest, DoNotForceQuicForHttps) {
CreateSession();
SendRequestAndExpectHttpResponse("hello world");
+ EXPECT_EQ(0U, test_network_quality_estimator_->GetWatchersCreated());
}
TEST_P(QuicNetworkTransactionTest, UseAlternativeServiceForQuic) {
@@ -1721,6 +1799,8 @@ TEST_P(QuicNetworkTransactionTest, SecureResourceOverInsecureQuic) {
TEST_P(QuicNetworkTransactionTest, SecureResourceOverSecureQuic) {
params_.enable_insecure_quic = true;
maker_.set_hostname("www.example.org");
+ EXPECT_FALSE(
+ test_network_quality_estimator_->IsRTTAvailableNotificationReceived());
MockQuicData mock_quic_data;
mock_quic_data.AddWrite(
ConstructRequestHeadersPacket(1, kClientDataStreamId1, true, true,
@@ -1748,6 +1828,8 @@ TEST_P(QuicNetworkTransactionTest, SecureResourceOverSecureQuic) {
CreateSessionWithNextProtos();
AddQuicAlternateProtocolMapping(MockCryptoClientStream::CONFIRM_HANDSHAKE);
SendRequestAndExpectQuicResponse("hello!");
+ EXPECT_TRUE(
+ test_network_quality_estimator_->IsRTTAvailableNotificationReceived());
}
} // namespace test
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index 4aa8b76..bf6d977 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"
@@ -570,6 +572,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,
@@ -602,6 +605,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),
@@ -1274,12 +1278,21 @@ int QuicStreamFactory::CreateSession(const QuicServerId& server_id,
server_info->Start();
}
+ // Use the factory to create a new socket performance watcher, and pass the
+ // ownership to QuicChromiumClientSession.
+ scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher;
+ if (socket_performance_watcher_factory_) {
+ socket_performance_watcher = socket_performance_watcher_factory_
+ ->CreateUDPSocketPerformanceWatcher();
+ }
+
*session = new QuicChromiumClientSession(
connection, socket.Pass(), this, quic_crypto_client_stream_factory_,
transport_security_state_, server_info.Pass(), server_id,
cert_verify_flags, config, &crypto_config_,
network_connection_.GetDescription(), dns_resolution_end_time,
- base::ThreadTaskRunnerHandle::Get().get(), net_log.net_log());
+ base::ThreadTaskRunnerHandle::Get().get(),
+ socket_performance_watcher.Pass(), net_log.net_log());
all_sessions_[*session] = server_id; // owning pointer
diff --git a/net/quic/quic_stream_factory.h b/net/quic/quic_stream_factory.h
index b61ab237..65b1e95 100644
--- a/net/quic/quic_stream_factory.h
+++ b/net/quic/quic_stream_factory.h
@@ -44,6 +44,7 @@ class QuicRandom;
class QuicServerInfoFactory;
class QuicServerId;
class QuicStreamFactory;
+class SocketPerformanceWatcherFactory;
class TransportSecurityState;
namespace test {
@@ -116,6 +117,7 @@ class NET_EXPORT_PRIVATE 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,
@@ -348,6 +350,11 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
scoped_ptr<QuicClock> clock_;
const size_t max_packet_length_;
+ // Factory which is used to create socket performance watcher. A new watcher
+ // is created for every QUIC connection.
+ // |socket_performance_watcher_factory_| may be null.
+ const SocketPerformanceWatcherFactory* socket_performance_watcher_factory_;
+
// The helper used for all connections.
scoped_ptr<QuicConnectionHelper> helper_;
diff --git a/net/quic/quic_stream_factory_test.cc b/net/quic/quic_stream_factory_test.cc
index 3c2afbf..4206047 100644
--- a/net/quic/quic_stream_factory_test.cc
+++ b/net/quic/quic_stream_factory_test.cc
@@ -260,6 +260,7 @@ class QuicStreamFactoryTest : public ::testing::TestWithParam<TestParams> {
nullptr,
channel_id_service_.get(),
&transport_security_state_,
+ /*SocketPerformanceWatcherFactory*/ nullptr,
&crypto_client_stream_factory_,
&random_generator_,
clock_,