| 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 HttpAuthHandlerFactory::CreateDefault(host_resolver.get())), | 336 HttpAuthHandlerFactory::CreateDefault(host_resolver.get())), |
| 337 http_server_properties(new HttpServerPropertiesImpl), | 337 http_server_properties(new HttpServerPropertiesImpl), |
| 338 enable_ip_pooling(true), | 338 enable_ip_pooling(true), |
| 339 enable_ping(false), | 339 enable_ping(false), |
| 340 enable_user_alternate_protocol_ports(false), | 340 enable_user_alternate_protocol_ports(false), |
| 341 enable_quic(false), | 341 enable_quic(false), |
| 342 session_max_recv_window_size(kDefaultInitialWindowSize), | 342 session_max_recv_window_size(kDefaultInitialWindowSize), |
| 343 stream_max_recv_window_size(kDefaultInitialWindowSize), | 343 stream_max_recv_window_size(kDefaultInitialWindowSize), |
| 344 time_func(&base::TimeTicks::Now), | 344 time_func(&base::TimeTicks::Now), |
| 345 enable_http2_alternative_service_with_different_host(false), | 345 enable_http2_alternative_service_with_different_host(false), |
| 346 net_log(NULL) { | 346 net_log(nullptr), |
| 347 http_09_on_non_default_ports_enabled(false) { |
| 347 // Note: The CancelledTransaction test does cleanup by running all | 348 // Note: The CancelledTransaction test does cleanup by running all |
| 348 // tasks in the message loop (RunAllPending). Unfortunately, that | 349 // tasks in the message loop (RunAllPending). Unfortunately, that |
| 349 // doesn't clean up tasks on the host resolver thread; and | 350 // doesn't clean up tasks on the host resolver thread; and |
| 350 // TCPConnectJob is currently not cancellable. Using synchronous | 351 // TCPConnectJob is currently not cancellable. Using synchronous |
| 351 // lookups allows the test to shutdown cleanly. Until we have | 352 // lookups allows the test to shutdown cleanly. Until we have |
| 352 // cancellable TCPConnectJobs, use synchronous lookups. | 353 // cancellable TCPConnectJobs, use synchronous lookups. |
| 353 host_resolver->set_synchronous_mode(true); | 354 host_resolver->set_synchronous_mode(true); |
| 354 } | 355 } |
| 355 | 356 |
| 356 SpdySessionDependencies::~SpdySessionDependencies() {} | 357 SpdySessionDependencies::~SpdySessionDependencies() {} |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 params.enable_quic = session_deps->enable_quic; | 391 params.enable_quic = session_deps->enable_quic; |
| 391 params.spdy_session_max_recv_window_size = | 392 params.spdy_session_max_recv_window_size = |
| 392 session_deps->session_max_recv_window_size; | 393 session_deps->session_max_recv_window_size; |
| 393 params.spdy_stream_max_recv_window_size = | 394 params.spdy_stream_max_recv_window_size = |
| 394 session_deps->stream_max_recv_window_size; | 395 session_deps->stream_max_recv_window_size; |
| 395 params.time_func = session_deps->time_func; | 396 params.time_func = session_deps->time_func; |
| 396 params.proxy_delegate = session_deps->proxy_delegate.get(); | 397 params.proxy_delegate = session_deps->proxy_delegate.get(); |
| 397 params.enable_http2_alternative_service_with_different_host = | 398 params.enable_http2_alternative_service_with_different_host = |
| 398 session_deps->enable_http2_alternative_service_with_different_host; | 399 session_deps->enable_http2_alternative_service_with_different_host; |
| 399 params.net_log = session_deps->net_log; | 400 params.net_log = session_deps->net_log; |
| 401 params.http_09_on_non_default_ports_enabled = |
| 402 session_deps->http_09_on_non_default_ports_enabled; |
| 400 return params; | 403 return params; |
| 401 } | 404 } |
| 402 | 405 |
| 403 SpdyURLRequestContext::SpdyURLRequestContext() : storage_(this) { | 406 SpdyURLRequestContext::SpdyURLRequestContext() : storage_(this) { |
| 404 storage_.set_host_resolver( | 407 storage_.set_host_resolver( |
| 405 std::unique_ptr<HostResolver>(new MockHostResolver)); | 408 std::unique_ptr<HostResolver>(new MockHostResolver)); |
| 406 storage_.set_cert_verifier(base::WrapUnique(new MockCertVerifier)); | 409 storage_.set_cert_verifier(base::WrapUnique(new MockCertVerifier)); |
| 407 storage_.set_transport_security_state( | 410 storage_.set_transport_security_state( |
| 408 base::WrapUnique(new TransportSecurityState)); | 411 base::WrapUnique(new TransportSecurityState)); |
| 409 storage_.set_proxy_service(ProxyService::CreateDirect()); | 412 storage_.set_proxy_service(ProxyService::CreateDirect()); |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 headers[GetSchemeKey()] = scheme.c_str(); | 1099 headers[GetSchemeKey()] = scheme.c_str(); |
| 1097 headers[GetPathKey()] = path.c_str(); | 1100 headers[GetPathKey()] = path.c_str(); |
| 1098 if (content_length) { | 1101 if (content_length) { |
| 1099 std::string length_str = base::Int64ToString(*content_length); | 1102 std::string length_str = base::Int64ToString(*content_length); |
| 1100 headers["content-length"] = length_str; | 1103 headers["content-length"] = length_str; |
| 1101 } | 1104 } |
| 1102 return headers; | 1105 return headers; |
| 1103 } | 1106 } |
| 1104 | 1107 |
| 1105 } // namespace net | 1108 } // namespace net |
| OLD | NEW |