| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/spdy/spdy_test_util_common.h" | 5 #include "net/spdy/spdy_test_util_common.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 storage_.set_proxy_service(ProxyService::CreateDirect()); | 450 storage_.set_proxy_service(ProxyService::CreateDirect()); |
| 451 storage_.set_ct_policy_enforcer( | 451 storage_.set_ct_policy_enforcer( |
| 452 base::WrapUnique(new AllowAnyCertCTPolicyEnforcer())); | 452 base::WrapUnique(new AllowAnyCertCTPolicyEnforcer())); |
| 453 storage_.set_cert_transparency_verifier( | 453 storage_.set_cert_transparency_verifier( |
| 454 base::WrapUnique(new IgnoresCTVerifier())); | 454 base::WrapUnique(new IgnoresCTVerifier())); |
| 455 storage_.set_ssl_config_service(new SSLConfigServiceDefaults); | 455 storage_.set_ssl_config_service(new SSLConfigServiceDefaults); |
| 456 storage_.set_http_auth_handler_factory( | 456 storage_.set_http_auth_handler_factory( |
| 457 HttpAuthHandlerFactory::CreateDefault(host_resolver())); | 457 HttpAuthHandlerFactory::CreateDefault(host_resolver())); |
| 458 storage_.set_http_server_properties( | 458 storage_.set_http_server_properties( |
| 459 std::unique_ptr<HttpServerProperties>(new HttpServerPropertiesImpl())); | 459 std::unique_ptr<HttpServerProperties>(new HttpServerPropertiesImpl())); |
| 460 storage_.set_job_factory(base::WrapUnique(new URLRequestJobFactoryImpl())); | 460 storage_.set_job_factory(base::MakeUnique<URLRequestJobFactoryImpl>()); |
| 461 HttpNetworkSession::Params params; | 461 HttpNetworkSession::Params params; |
| 462 params.client_socket_factory = &socket_factory_; | 462 params.client_socket_factory = &socket_factory_; |
| 463 params.host_resolver = host_resolver(); | 463 params.host_resolver = host_resolver(); |
| 464 params.cert_verifier = cert_verifier(); | 464 params.cert_verifier = cert_verifier(); |
| 465 params.transport_security_state = transport_security_state(); | 465 params.transport_security_state = transport_security_state(); |
| 466 params.proxy_service = proxy_service(); | 466 params.proxy_service = proxy_service(); |
| 467 params.ct_policy_enforcer = ct_policy_enforcer(); | 467 params.ct_policy_enforcer = ct_policy_enforcer(); |
| 468 params.cert_transparency_verifier = cert_transparency_verifier(); | 468 params.cert_transparency_verifier = cert_transparency_verifier(); |
| 469 params.ssl_config_service = ssl_config_service(); | 469 params.ssl_config_service = ssl_config_service(); |
| 470 params.http_auth_handler_factory = http_auth_handler_factory(); | 470 params.http_auth_handler_factory = http_auth_handler_factory(); |
| 471 params.enable_spdy_ping_based_connection_checking = false; | 471 params.enable_spdy_ping_based_connection_checking = false; |
| 472 params.http_server_properties = http_server_properties(); | 472 params.http_server_properties = http_server_properties(); |
| 473 storage_.set_http_network_session( | 473 storage_.set_http_network_session( |
| 474 base::WrapUnique(new HttpNetworkSession(params))); | 474 base::MakeUnique<HttpNetworkSession>(params)); |
| 475 SpdySessionPoolPeer pool_peer( | 475 SpdySessionPoolPeer pool_peer( |
| 476 storage_.http_network_session()->spdy_session_pool()); | 476 storage_.http_network_session()->spdy_session_pool()); |
| 477 pool_peer.SetEnableSendingInitialData(false); | 477 pool_peer.SetEnableSendingInitialData(false); |
| 478 storage_.set_http_transaction_factory(base::WrapUnique( | 478 storage_.set_http_transaction_factory(base::MakeUnique<HttpCache>( |
| 479 new HttpCache(storage_.http_network_session(), | 479 storage_.http_network_session(), HttpCache::DefaultBackend::InMemory(0), |
| 480 HttpCache::DefaultBackend::InMemory(0), false))); | 480 false)); |
| 481 } | 481 } |
| 482 | 482 |
| 483 SpdyURLRequestContext::~SpdyURLRequestContext() { | 483 SpdyURLRequestContext::~SpdyURLRequestContext() { |
| 484 AssertNoURLRequests(); | 484 AssertNoURLRequests(); |
| 485 } | 485 } |
| 486 | 486 |
| 487 bool HasSpdySession(SpdySessionPool* pool, const SpdySessionKey& key) { | 487 bool HasSpdySession(SpdySessionPool* pool, const SpdySessionKey& key) { |
| 488 return static_cast<bool>( | 488 return static_cast<bool>( |
| 489 pool->FindAvailableSession(key, GURL(), BoundNetLog())); | 489 pool->FindAvailableSession(key, GURL(), BoundNetLog())); |
| 490 } | 490 } |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1143 headers[GetSchemeKey()] = scheme.c_str(); | 1143 headers[GetSchemeKey()] = scheme.c_str(); |
| 1144 headers[GetPathKey()] = path.c_str(); | 1144 headers[GetPathKey()] = path.c_str(); |
| 1145 if (content_length) { | 1145 if (content_length) { |
| 1146 std::string length_str = base::Int64ToString(*content_length); | 1146 std::string length_str = base::Int64ToString(*content_length); |
| 1147 headers["content-length"] = length_str; | 1147 headers["content-length"] = length_str; |
| 1148 } | 1148 } |
| 1149 return headers; | 1149 return headers; |
| 1150 } | 1150 } |
| 1151 | 1151 |
| 1152 } // namespace net | 1152 } // namespace net |
| OLD | NEW |