| 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 <memory> | 10 #include <memory> |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 enable_priority_dependencies(true), | 357 enable_priority_dependencies(true), |
| 358 enable_spdy31(true), | 358 enable_spdy31(true), |
| 359 enable_quic(false), | 359 enable_quic(false), |
| 360 enable_alternative_service_for_insecure_origins(true), | 360 enable_alternative_service_for_insecure_origins(true), |
| 361 protocol(protocol), | 361 protocol(protocol), |
| 362 session_max_recv_window_size( | 362 session_max_recv_window_size( |
| 363 SpdySession::GetDefaultInitialWindowSize(protocol)), | 363 SpdySession::GetDefaultInitialWindowSize(protocol)), |
| 364 stream_max_recv_window_size( | 364 stream_max_recv_window_size( |
| 365 SpdySession::GetDefaultInitialWindowSize(protocol)), | 365 SpdySession::GetDefaultInitialWindowSize(protocol)), |
| 366 time_func(&base::TimeTicks::Now), | 366 time_func(&base::TimeTicks::Now), |
| 367 enable_alternative_service_with_different_host(true), | 367 enable_http2_alternative_service_with_different_host(false), |
| 368 net_log(NULL) { | 368 net_log(NULL) { |
| 369 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; | 369 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; |
| 370 | 370 |
| 371 // Note: The CancelledTransaction test does cleanup by running all | 371 // Note: The CancelledTransaction test does cleanup by running all |
| 372 // tasks in the message loop (RunAllPending). Unfortunately, that | 372 // tasks in the message loop (RunAllPending). Unfortunately, that |
| 373 // doesn't clean up tasks on the host resolver thread; and | 373 // doesn't clean up tasks on the host resolver thread; and |
| 374 // TCPConnectJob is currently not cancellable. Using synchronous | 374 // TCPConnectJob is currently not cancellable. Using synchronous |
| 375 // lookups allows the test to shutdown cleanly. Until we have | 375 // lookups allows the test to shutdown cleanly. Until we have |
| 376 // cancellable TCPConnectJobs, use synchronous lookups. | 376 // cancellable TCPConnectJobs, use synchronous lookups. |
| 377 host_resolver->set_synchronous_mode(true); | 377 host_resolver->set_synchronous_mode(true); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 params.enable_quic = session_deps->enable_quic; | 421 params.enable_quic = session_deps->enable_quic; |
| 422 params.enable_alternative_service_for_insecure_origins = | 422 params.enable_alternative_service_for_insecure_origins = |
| 423 session_deps->enable_alternative_service_for_insecure_origins; | 423 session_deps->enable_alternative_service_for_insecure_origins; |
| 424 params.spdy_default_protocol = session_deps->protocol; | 424 params.spdy_default_protocol = session_deps->protocol; |
| 425 params.spdy_session_max_recv_window_size = | 425 params.spdy_session_max_recv_window_size = |
| 426 session_deps->session_max_recv_window_size; | 426 session_deps->session_max_recv_window_size; |
| 427 params.spdy_stream_max_recv_window_size = | 427 params.spdy_stream_max_recv_window_size = |
| 428 session_deps->stream_max_recv_window_size; | 428 session_deps->stream_max_recv_window_size; |
| 429 params.time_func = session_deps->time_func; | 429 params.time_func = session_deps->time_func; |
| 430 params.proxy_delegate = session_deps->proxy_delegate.get(); | 430 params.proxy_delegate = session_deps->proxy_delegate.get(); |
| 431 params.enable_alternative_service_with_different_host = | 431 params.enable_http2_alternative_service_with_different_host = |
| 432 session_deps->enable_alternative_service_with_different_host; | 432 session_deps->enable_http2_alternative_service_with_different_host; |
| 433 params.net_log = session_deps->net_log; | 433 params.net_log = session_deps->net_log; |
| 434 return params; | 434 return params; |
| 435 } | 435 } |
| 436 | 436 |
| 437 SpdyURLRequestContext::SpdyURLRequestContext(NextProto protocol) | 437 SpdyURLRequestContext::SpdyURLRequestContext(NextProto protocol) |
| 438 : storage_(this) { | 438 : storage_(this) { |
| 439 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; | 439 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; |
| 440 | 440 |
| 441 storage_.set_host_resolver( | 441 storage_.set_host_resolver( |
| 442 std::unique_ptr<HostResolver>(new MockHostResolver)); | 442 std::unique_ptr<HostResolver>(new MockHostResolver)); |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1299 } | 1299 } |
| 1300 } | 1300 } |
| 1301 | 1301 |
| 1302 void SpdyTestUtil::SetPriority(RequestPriority priority, | 1302 void SpdyTestUtil::SetPriority(RequestPriority priority, |
| 1303 SpdySynStreamIR* ir) const { | 1303 SpdySynStreamIR* ir) const { |
| 1304 ir->set_priority(ConvertRequestPriorityToSpdyPriority( | 1304 ir->set_priority(ConvertRequestPriorityToSpdyPriority( |
| 1305 priority, spdy_version())); | 1305 priority, spdy_version())); |
| 1306 } | 1306 } |
| 1307 | 1307 |
| 1308 } // namespace net | 1308 } // namespace net |
| OLD | NEW |