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