| 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 http_auth_handler_factory( | 349 http_auth_handler_factory( |
| 350 HttpAuthHandlerFactory::CreateDefault(host_resolver.get())), | 350 HttpAuthHandlerFactory::CreateDefault(host_resolver.get())), |
| 351 http_server_properties(new HttpServerPropertiesImpl), | 351 http_server_properties(new HttpServerPropertiesImpl), |
| 352 enable_ip_pooling(true), | 352 enable_ip_pooling(true), |
| 353 enable_ping(false), | 353 enable_ping(false), |
| 354 enable_user_alternate_protocol_ports(false), | 354 enable_user_alternate_protocol_ports(false), |
| 355 enable_npn(false), | 355 enable_npn(false), |
| 356 enable_priority_dependencies(true), | 356 enable_priority_dependencies(true), |
| 357 enable_spdy31(true), | 357 enable_spdy31(true), |
| 358 enable_quic(false), | 358 enable_quic(false), |
| 359 enable_alternative_service_for_insecure_origins(true), | |
| 360 protocol(protocol), | 359 protocol(protocol), |
| 361 session_max_recv_window_size( | 360 session_max_recv_window_size( |
| 362 SpdySession::GetDefaultInitialWindowSize(protocol)), | 361 SpdySession::GetDefaultInitialWindowSize(protocol)), |
| 363 stream_max_recv_window_size( | 362 stream_max_recv_window_size( |
| 364 SpdySession::GetDefaultInitialWindowSize(protocol)), | 363 SpdySession::GetDefaultInitialWindowSize(protocol)), |
| 365 time_func(&base::TimeTicks::Now), | 364 time_func(&base::TimeTicks::Now), |
| 366 enable_http2_alternative_service_with_different_host(false), | 365 enable_http2_alternative_service_with_different_host(false), |
| 367 net_log(NULL) { | 366 net_log(NULL) { |
| 368 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; | 367 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; |
| 369 | 368 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 session_deps->http_auth_handler_factory.get(); | 410 session_deps->http_auth_handler_factory.get(); |
| 412 params.http_server_properties = session_deps->http_server_properties.get(); | 411 params.http_server_properties = session_deps->http_server_properties.get(); |
| 413 params.enable_spdy_ping_based_connection_checking = session_deps->enable_ping; | 412 params.enable_spdy_ping_based_connection_checking = session_deps->enable_ping; |
| 414 params.enable_user_alternate_protocol_ports = | 413 params.enable_user_alternate_protocol_ports = |
| 415 session_deps->enable_user_alternate_protocol_ports; | 414 session_deps->enable_user_alternate_protocol_ports; |
| 416 params.enable_npn = session_deps->enable_npn; | 415 params.enable_npn = session_deps->enable_npn; |
| 417 params.enable_priority_dependencies = | 416 params.enable_priority_dependencies = |
| 418 session_deps->enable_priority_dependencies; | 417 session_deps->enable_priority_dependencies; |
| 419 params.enable_spdy31 = session_deps->enable_spdy31; | 418 params.enable_spdy31 = session_deps->enable_spdy31; |
| 420 params.enable_quic = session_deps->enable_quic; | 419 params.enable_quic = session_deps->enable_quic; |
| 421 params.enable_alternative_service_for_insecure_origins = | |
| 422 session_deps->enable_alternative_service_for_insecure_origins; | |
| 423 params.spdy_default_protocol = session_deps->protocol; | 420 params.spdy_default_protocol = session_deps->protocol; |
| 424 params.spdy_session_max_recv_window_size = | 421 params.spdy_session_max_recv_window_size = |
| 425 session_deps->session_max_recv_window_size; | 422 session_deps->session_max_recv_window_size; |
| 426 params.spdy_stream_max_recv_window_size = | 423 params.spdy_stream_max_recv_window_size = |
| 427 session_deps->stream_max_recv_window_size; | 424 session_deps->stream_max_recv_window_size; |
| 428 params.time_func = session_deps->time_func; | 425 params.time_func = session_deps->time_func; |
| 429 params.proxy_delegate = session_deps->proxy_delegate.get(); | 426 params.proxy_delegate = session_deps->proxy_delegate.get(); |
| 430 params.enable_http2_alternative_service_with_different_host = | 427 params.enable_http2_alternative_service_with_different_host = |
| 431 session_deps->enable_http2_alternative_service_with_different_host; | 428 session_deps->enable_http2_alternative_service_with_different_host; |
| 432 params.net_log = session_deps->net_log; | 429 params.net_log = session_deps->net_log; |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 void SpdySessionPoolPeer::SetStreamInitialRecvWindowSize(size_t window) { | 674 void SpdySessionPoolPeer::SetStreamInitialRecvWindowSize(size_t window) { |
| 678 pool_->stream_max_recv_window_size_ = window; | 675 pool_->stream_max_recv_window_size_ = window; |
| 679 } | 676 } |
| 680 | 677 |
| 681 SpdyTestUtil::SpdyTestUtil(NextProto protocol, bool dependency_priorities) | 678 SpdyTestUtil::SpdyTestUtil(NextProto protocol, bool dependency_priorities) |
| 682 : protocol_(protocol), | 679 : protocol_(protocol), |
| 683 spdy_version_(NextProtoToSpdyMajorVersion(protocol)), | 680 spdy_version_(NextProtoToSpdyMajorVersion(protocol)), |
| 684 headerless_spdy_framer_(spdy_version_), | 681 headerless_spdy_framer_(spdy_version_), |
| 685 request_spdy_framer_(spdy_version_), | 682 request_spdy_framer_(spdy_version_), |
| 686 response_spdy_framer_(spdy_version_), | 683 response_spdy_framer_(spdy_version_), |
| 687 default_url_(GURL(kDefaultURL)), | 684 default_url_(GURL(kDefaultUrl)), |
| 688 dependency_priorities_(dependency_priorities) { | 685 dependency_priorities_(dependency_priorities) { |
| 689 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; | 686 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; |
| 690 } | 687 } |
| 691 | 688 |
| 692 SpdyTestUtil::~SpdyTestUtil() {} | 689 SpdyTestUtil::~SpdyTestUtil() {} |
| 693 | 690 |
| 694 void SpdyTestUtil::AddUrlToHeaderBlock(base::StringPiece url, | 691 void SpdyTestUtil::AddUrlToHeaderBlock(base::StringPiece url, |
| 695 SpdyHeaderBlock* headers) const { | 692 SpdyHeaderBlock* headers) const { |
| 696 std::string scheme, host, path; | 693 std::string scheme, host, path; |
| 697 ParseUrl(url, &scheme, &host, &path); | 694 ParseUrl(url, &scheme, &host, &path); |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1284 } | 1281 } |
| 1285 } | 1282 } |
| 1286 | 1283 |
| 1287 void SpdyTestUtil::SetPriority(RequestPriority priority, | 1284 void SpdyTestUtil::SetPriority(RequestPriority priority, |
| 1288 SpdySynStreamIR* ir) const { | 1285 SpdySynStreamIR* ir) const { |
| 1289 ir->set_priority(ConvertRequestPriorityToSpdyPriority( | 1286 ir->set_priority(ConvertRequestPriorityToSpdyPriority( |
| 1290 priority, spdy_version())); | 1287 priority, spdy_version())); |
| 1291 } | 1288 } |
| 1292 | 1289 |
| 1293 } // namespace net | 1290 } // namespace net |
| OLD | NEW |