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

Side by Side Diff: net/quic/quic_stream_factory_test.cc

Issue 2041863002: Remove HttpServerProperies::GetWeakPtr(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 6 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.cc ('k') | net/socket/ssl_client_socket_pool_unittest.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 <ostream> 7 #include <ostream>
8 8
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 // If |factory_| was not initialized, then |clock_| needs to be destroyed. 305 // If |factory_| was not initialized, then |clock_| needs to be destroyed.
306 if (!factory_) { 306 if (!factory_) {
307 delete clock_; 307 delete clock_;
308 } 308 }
309 } 309 }
310 310
311 void Initialize() { 311 void Initialize() {
312 DCHECK(!factory_); 312 DCHECK(!factory_);
313 factory_.reset(new QuicStreamFactory( 313 factory_.reset(new QuicStreamFactory(
314 net_log_.net_log(), &host_resolver_, &socket_factory_, 314 net_log_.net_log(), &host_resolver_, &socket_factory_,
315 http_server_properties_.GetWeakPtr(), cert_verifier_.get(), nullptr, 315 &http_server_properties_, cert_verifier_.get(), nullptr,
316 channel_id_service_.get(), &transport_security_state_, 316 channel_id_service_.get(), &transport_security_state_,
317 cert_transparency_verifier_.get(), 317 cert_transparency_verifier_.get(),
318 /*SocketPerformanceWatcherFactory*/ nullptr, 318 /*SocketPerformanceWatcherFactory*/ nullptr,
319 &crypto_client_stream_factory_, &random_generator_, clock_, 319 &crypto_client_stream_factory_, &random_generator_, clock_,
320 kDefaultMaxPacketSize, string(), SupportedVersions(version_), 320 kDefaultMaxPacketSize, string(), SupportedVersions(version_),
321 enable_port_selection_, always_require_handshake_confirmation_, 321 enable_port_selection_, always_require_handshake_confirmation_,
322 disable_connection_pooling_, load_server_info_timeout_srtt_multiplier_, 322 disable_connection_pooling_, load_server_info_timeout_srtt_multiplier_,
323 enable_connection_racing_, enable_non_blocking_io_, disable_disk_cache_, 323 enable_connection_racing_, enable_non_blocking_io_, disable_disk_cache_,
324 prefer_aes_, max_number_of_lossy_connections_, packet_loss_threshold_, 324 prefer_aes_, max_number_of_lossy_connections_, packet_loss_threshold_,
325 max_disabled_reasons_, threshold_timeouts_with_open_streams_, 325 max_disabled_reasons_, threshold_timeouts_with_open_streams_,
(...skipping 3395 matching lines...) Expand 10 before | Expand all | Expand 10 after
3721 AlternativeServiceInfo(alternative_service2, expiration)); 3721 AlternativeServiceInfo(alternative_service2, expiration));
3722 http_server_properties_.SetAlternativeServices( 3722 http_server_properties_.SetAlternativeServices(
3723 server2, alternative_service_info_vector2); 3723 server2, alternative_service_info_vector2);
3724 3724
3725 http_server_properties_.SetMaxServerConfigsStoredInProperties( 3725 http_server_properties_.SetMaxServerConfigsStoredInProperties(
3726 kMaxQuicServersToPersist); 3726 kMaxQuicServersToPersist);
3727 3727
3728 QuicServerId quic_server_id(kDefaultServerHostName, 80, 3728 QuicServerId quic_server_id(kDefaultServerHostName, 80,
3729 PRIVACY_MODE_DISABLED); 3729 PRIVACY_MODE_DISABLED);
3730 QuicServerInfoFactory* quic_server_info_factory = 3730 QuicServerInfoFactory* quic_server_info_factory =
3731 new PropertiesBasedQuicServerInfoFactory( 3731 new PropertiesBasedQuicServerInfoFactory(&http_server_properties_);
3732 http_server_properties_.GetWeakPtr());
3733 factory_->set_quic_server_info_factory(quic_server_info_factory); 3732 factory_->set_quic_server_info_factory(quic_server_info_factory);
3734 3733
3735 std::unique_ptr<QuicServerInfo> quic_server_info( 3734 std::unique_ptr<QuicServerInfo> quic_server_info(
3736 quic_server_info_factory->GetForServer(quic_server_id)); 3735 quic_server_info_factory->GetForServer(quic_server_id));
3737 3736
3738 // Update quic_server_info's server_config and persist it. 3737 // Update quic_server_info's server_config and persist it.
3739 QuicServerInfo::State* state = quic_server_info->mutable_state(); 3738 QuicServerInfo::State* state = quic_server_info->mutable_state();
3740 // Minimum SCFG that passes config validation checks. 3739 // Minimum SCFG that passes config validation checks.
3741 const char scfg[] = {// SCFG 3740 const char scfg[] = {// SCFG
3742 0x53, 0x43, 0x46, 0x47, 3741 0x53, 0x43, 0x46, 0x47,
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
4329 EXPECT_NE(session1, session2); 4328 EXPECT_NE(session1, session2);
4330 4329
4331 EXPECT_EQ(QuicServerId(origin1_, privacy_mode_), session1->server_id()); 4330 EXPECT_EQ(QuicServerId(origin1_, privacy_mode_), session1->server_id());
4332 EXPECT_EQ(QuicServerId(origin2_, privacy_mode_), session2->server_id()); 4331 EXPECT_EQ(QuicServerId(origin2_, privacy_mode_), session2->server_id());
4333 4332
4334 EXPECT_TRUE(AllDataConsumed()); 4333 EXPECT_TRUE(AllDataConsumed());
4335 } 4334 }
4336 4335
4337 } // namespace test 4336 } // namespace test
4338 } // namespace net 4337 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/socket/ssl_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698