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

Side by Side 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: Removed a test 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_stream_factory.h" 5 #include "net/quic/quic_stream_factory.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
11 #include "base/metrics/field_trial.h" 11 #include "base/metrics/field_trial.h"
12 #include "base/metrics/histogram_macros.h" 12 #include "base/metrics/histogram_macros.h"
13 #include "base/metrics/sparse_histogram.h" 13 #include "base/metrics/sparse_histogram.h"
14 #include "base/rand_util.h" 14 #include "base/rand_util.h"
15 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
16 #include "base/stl_util.h" 16 #include "base/stl_util.h"
17 #include "base/strings/string_util.h" 17 #include "base/strings/string_util.h"
18 #include "base/strings/stringprintf.h" 18 #include "base/strings/stringprintf.h"
19 #include "base/thread_task_runner_handle.h" 19 #include "base/thread_task_runner_handle.h"
20 #include "base/values.h" 20 #include "base/values.h"
21 #include "net/base/net_errors.h" 21 #include "net/base/net_errors.h"
22 #include "net/base/socket_performance_watcher.h"
23 #include "net/base/socket_performance_watcher_factory.h"
22 #include "net/cert/cert_verifier.h" 24 #include "net/cert/cert_verifier.h"
23 #include "net/dns/host_resolver.h" 25 #include "net/dns/host_resolver.h"
24 #include "net/dns/single_request_host_resolver.h" 26 #include "net/dns/single_request_host_resolver.h"
25 #include "net/http/http_server_properties.h" 27 #include "net/http/http_server_properties.h"
26 #include "net/quic/crypto/channel_id_chromium.h" 28 #include "net/quic/crypto/channel_id_chromium.h"
27 #include "net/quic/crypto/proof_verifier_chromium.h" 29 #include "net/quic/crypto/proof_verifier_chromium.h"
28 #include "net/quic/crypto/quic_random.h" 30 #include "net/quic/crypto/quic_random.h"
29 #include "net/quic/crypto/quic_server_info.h" 31 #include "net/quic/crypto/quic_server_info.h"
30 #include "net/quic/port_suggester.h" 32 #include "net/quic/port_suggester.h"
31 #include "net/quic/quic_chromium_client_session.h" 33 #include "net/quic/quic_chromium_client_session.h"
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 } 565 }
564 566
565 QuicStreamFactory::QuicStreamFactory( 567 QuicStreamFactory::QuicStreamFactory(
566 HostResolver* host_resolver, 568 HostResolver* host_resolver,
567 ClientSocketFactory* client_socket_factory, 569 ClientSocketFactory* client_socket_factory,
568 base::WeakPtr<HttpServerProperties> http_server_properties, 570 base::WeakPtr<HttpServerProperties> http_server_properties,
569 CertVerifier* cert_verifier, 571 CertVerifier* cert_verifier,
570 CertPolicyEnforcer* cert_policy_enforcer, 572 CertPolicyEnforcer* cert_policy_enforcer,
571 ChannelIDService* channel_id_service, 573 ChannelIDService* channel_id_service,
572 TransportSecurityState* transport_security_state, 574 TransportSecurityState* transport_security_state,
575 const SocketPerformanceWatcherFactory* socket_performance_watcher_factory,
573 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory, 576 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory,
574 QuicRandom* random_generator, 577 QuicRandom* random_generator,
575 QuicClock* clock, 578 QuicClock* clock,
576 size_t max_packet_length, 579 size_t max_packet_length,
577 const std::string& user_agent_id, 580 const std::string& user_agent_id,
578 const QuicVersionVector& supported_versions, 581 const QuicVersionVector& supported_versions,
579 bool enable_port_selection, 582 bool enable_port_selection,
580 bool always_require_handshake_confirmation, 583 bool always_require_handshake_confirmation,
581 bool disable_connection_pooling, 584 bool disable_connection_pooling,
582 float load_server_info_timeout_srtt_multiplier, 585 float load_server_info_timeout_srtt_multiplier,
(...skipping 12 matching lines...) Expand all
595 : require_confirmation_(true), 598 : require_confirmation_(true),
596 host_resolver_(host_resolver), 599 host_resolver_(host_resolver),
597 client_socket_factory_(client_socket_factory), 600 client_socket_factory_(client_socket_factory),
598 http_server_properties_(http_server_properties), 601 http_server_properties_(http_server_properties),
599 transport_security_state_(transport_security_state), 602 transport_security_state_(transport_security_state),
600 quic_server_info_factory_(nullptr), 603 quic_server_info_factory_(nullptr),
601 quic_crypto_client_stream_factory_(quic_crypto_client_stream_factory), 604 quic_crypto_client_stream_factory_(quic_crypto_client_stream_factory),
602 random_generator_(random_generator), 605 random_generator_(random_generator),
603 clock_(clock), 606 clock_(clock),
604 max_packet_length_(max_packet_length), 607 max_packet_length_(max_packet_length),
608 socket_performance_watcher_factory_(socket_performance_watcher_factory),
605 config_(InitializeQuicConfig(connection_options)), 609 config_(InitializeQuicConfig(connection_options)),
606 supported_versions_(supported_versions), 610 supported_versions_(supported_versions),
607 enable_port_selection_(enable_port_selection), 611 enable_port_selection_(enable_port_selection),
608 always_require_handshake_confirmation_( 612 always_require_handshake_confirmation_(
609 always_require_handshake_confirmation), 613 always_require_handshake_confirmation),
610 disable_connection_pooling_(disable_connection_pooling), 614 disable_connection_pooling_(disable_connection_pooling),
611 load_server_info_timeout_srtt_multiplier_( 615 load_server_info_timeout_srtt_multiplier_(
612 load_server_info_timeout_srtt_multiplier), 616 load_server_info_timeout_srtt_multiplier),
613 enable_connection_racing_(enable_connection_racing), 617 enable_connection_racing_(enable_connection_racing),
614 enable_non_blocking_io_(enable_non_blocking_io), 618 enable_non_blocking_io_(enable_non_blocking_io),
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 config.SetBytesForConnectionIdToSend(0); 1280 config.SetBytesForConnectionIdToSend(0);
1277 1281
1278 if (quic_server_info_factory_ && !server_info) { 1282 if (quic_server_info_factory_ && !server_info) {
1279 // Start the disk cache loading so that we can persist the newer QUIC server 1283 // Start the disk cache loading so that we can persist the newer QUIC server
1280 // information and/or inform the disk cache that we have reused 1284 // information and/or inform the disk cache that we have reused
1281 // |server_info|. 1285 // |server_info|.
1282 server_info.reset(quic_server_info_factory_->GetForServer(server_id)); 1286 server_info.reset(quic_server_info_factory_->GetForServer(server_id));
1283 server_info->Start(); 1287 server_info->Start();
1284 } 1288 }
1285 1289
1290 // Use the factory to create a new socket performance watcher, and pass the
1291 // ownership to QuicChromiumClientSession.
1292 scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher;
1293 if (socket_performance_watcher_factory_) {
1294 socket_performance_watcher = socket_performance_watcher_factory_
1295 ->CreateUDPSocketPerformanceWatcher();
1296 }
1297
1286 *session = new QuicChromiumClientSession( 1298 *session = new QuicChromiumClientSession(
1287 connection, socket.Pass(), this, quic_crypto_client_stream_factory_, 1299 connection, socket.Pass(), this, quic_crypto_client_stream_factory_,
1288 transport_security_state_, server_info.Pass(), server_id, 1300 transport_security_state_, server_info.Pass(), server_id,
1289 cert_verify_flags, config, &crypto_config_, 1301 cert_verify_flags, config, &crypto_config_,
1290 network_connection_.GetDescription(), dns_resolution_end_time, 1302 network_connection_.GetDescription(), dns_resolution_end_time,
1291 base::ThreadTaskRunnerHandle::Get().get(), net_log.net_log()); 1303 base::ThreadTaskRunnerHandle::Get().get(),
1304 socket_performance_watcher.Pass(), net_log.net_log());
1292 1305
1293 all_sessions_[*session] = server_id; // owning pointer 1306 all_sessions_[*session] = server_id; // owning pointer
1294 1307
1295 (*session)->Initialize(); 1308 (*session)->Initialize();
1296 bool closed_during_initialize = 1309 bool closed_during_initialize =
1297 !ContainsKey(all_sessions_, *session) || 1310 !ContainsKey(all_sessions_, *session) ||
1298 !(*session)->connection()->connected(); 1311 !(*session)->connection()->connected();
1299 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.ClosedDuringInitializeSession", 1312 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.ClosedDuringInitializeSession",
1300 closed_during_initialize); 1313 closed_during_initialize);
1301 if (closed_during_initialize) { 1314 if (closed_during_initialize) {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1434 // Since the session was active, there's no longer an 1447 // Since the session was active, there's no longer an
1435 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP 1448 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP
1436 // job also fails. So to avoid not using QUIC when we otherwise could, we mark 1449 // job also fails. So to avoid not using QUIC when we otherwise could, we mark
1437 // it as recently broken, which means that 0-RTT will be disabled but we'll 1450 // it as recently broken, which means that 0-RTT will be disabled but we'll
1438 // still race. 1451 // still race.
1439 http_server_properties_->MarkAlternativeServiceRecentlyBroken( 1452 http_server_properties_->MarkAlternativeServiceRecentlyBroken(
1440 alternative_service); 1453 alternative_service);
1441 } 1454 }
1442 1455
1443 } // namespace net 1456 } // namespace net
OLDNEW
« 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