| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 enable_npn(false), | 342 enable_npn(false), |
| 343 enable_priority_dependencies(true), | 343 enable_priority_dependencies(true), |
| 344 enable_spdy31(true), | 344 enable_spdy31(true), |
| 345 enable_quic(false), | 345 enable_quic(false), |
| 346 protocol(protocol), | 346 protocol(protocol), |
| 347 session_max_recv_window_size( | 347 session_max_recv_window_size( |
| 348 SpdySession::GetDefaultInitialWindowSize(protocol)), | 348 SpdySession::GetDefaultInitialWindowSize(protocol)), |
| 349 stream_max_recv_window_size( | 349 stream_max_recv_window_size( |
| 350 SpdySession::GetDefaultInitialWindowSize(protocol)), | 350 SpdySession::GetDefaultInitialWindowSize(protocol)), |
| 351 time_func(&base::TimeTicks::Now), | 351 time_func(&base::TimeTicks::Now), |
| 352 parse_alternative_services(true), | |
| 353 enable_alternative_service_with_different_host(true), | 352 enable_alternative_service_with_different_host(true), |
| 354 net_log(NULL) { | 353 net_log(NULL) { |
| 355 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; | 354 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; |
| 356 | 355 |
| 357 // Note: The CancelledTransaction test does cleanup by running all | 356 // Note: The CancelledTransaction test does cleanup by running all |
| 358 // tasks in the message loop (RunAllPending). Unfortunately, that | 357 // tasks in the message loop (RunAllPending). Unfortunately, that |
| 359 // doesn't clean up tasks on the host resolver thread; and | 358 // doesn't clean up tasks on the host resolver thread; and |
| 360 // TCPConnectJob is currently not cancellable. Using synchronous | 359 // TCPConnectJob is currently not cancellable. Using synchronous |
| 361 // lookups allows the test to shutdown cleanly. Until we have | 360 // lookups allows the test to shutdown cleanly. Until we have |
| 362 // cancellable TCPConnectJobs, use synchronous lookups. | 361 // cancellable TCPConnectJobs, use synchronous lookups. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 381 enable_npn(false), | 380 enable_npn(false), |
| 382 enable_priority_dependencies(true), | 381 enable_priority_dependencies(true), |
| 383 enable_spdy31(true), | 382 enable_spdy31(true), |
| 384 enable_quic(false), | 383 enable_quic(false), |
| 385 protocol(protocol), | 384 protocol(protocol), |
| 386 session_max_recv_window_size( | 385 session_max_recv_window_size( |
| 387 SpdySession::GetDefaultInitialWindowSize(protocol)), | 386 SpdySession::GetDefaultInitialWindowSize(protocol)), |
| 388 stream_max_recv_window_size( | 387 stream_max_recv_window_size( |
| 389 SpdySession::GetDefaultInitialWindowSize(protocol)), | 388 SpdySession::GetDefaultInitialWindowSize(protocol)), |
| 390 time_func(&base::TimeTicks::Now), | 389 time_func(&base::TimeTicks::Now), |
| 391 parse_alternative_services(true), | |
| 392 enable_alternative_service_with_different_host(true), | 390 enable_alternative_service_with_different_host(true), |
| 393 net_log(NULL) { | 391 net_log(NULL) { |
| 394 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; | 392 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; |
| 395 } | 393 } |
| 396 | 394 |
| 397 SpdySessionDependencies::~SpdySessionDependencies() {} | 395 SpdySessionDependencies::~SpdySessionDependencies() {} |
| 398 | 396 |
| 399 // static | 397 // static |
| 400 std::unique_ptr<HttpNetworkSession> SpdySessionDependencies::SpdyCreateSession( | 398 std::unique_ptr<HttpNetworkSession> SpdySessionDependencies::SpdyCreateSession( |
| 401 SpdySessionDependencies* session_deps) { | 399 SpdySessionDependencies* session_deps) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 session_deps->enable_priority_dependencies; | 432 session_deps->enable_priority_dependencies; |
| 435 params.enable_spdy31 = session_deps->enable_spdy31; | 433 params.enable_spdy31 = session_deps->enable_spdy31; |
| 436 params.enable_quic = session_deps->enable_quic; | 434 params.enable_quic = session_deps->enable_quic; |
| 437 params.spdy_default_protocol = session_deps->protocol; | 435 params.spdy_default_protocol = session_deps->protocol; |
| 438 params.spdy_session_max_recv_window_size = | 436 params.spdy_session_max_recv_window_size = |
| 439 session_deps->session_max_recv_window_size; | 437 session_deps->session_max_recv_window_size; |
| 440 params.spdy_stream_max_recv_window_size = | 438 params.spdy_stream_max_recv_window_size = |
| 441 session_deps->stream_max_recv_window_size; | 439 session_deps->stream_max_recv_window_size; |
| 442 params.time_func = session_deps->time_func; | 440 params.time_func = session_deps->time_func; |
| 443 params.proxy_delegate = session_deps->proxy_delegate.get(); | 441 params.proxy_delegate = session_deps->proxy_delegate.get(); |
| 444 params.parse_alternative_services = session_deps->parse_alternative_services; | |
| 445 params.enable_alternative_service_with_different_host = | 442 params.enable_alternative_service_with_different_host = |
| 446 session_deps->enable_alternative_service_with_different_host; | 443 session_deps->enable_alternative_service_with_different_host; |
| 447 params.net_log = session_deps->net_log; | 444 params.net_log = session_deps->net_log; |
| 448 return params; | 445 return params; |
| 449 } | 446 } |
| 450 | 447 |
| 451 SpdyURLRequestContext::SpdyURLRequestContext(NextProto protocol) | 448 SpdyURLRequestContext::SpdyURLRequestContext(NextProto protocol) |
| 452 : storage_(this) { | 449 : storage_(this) { |
| 453 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; | 450 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; |
| 454 | 451 |
| (...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 } | 1307 } |
| 1311 } | 1308 } |
| 1312 | 1309 |
| 1313 void SpdyTestUtil::SetPriority(RequestPriority priority, | 1310 void SpdyTestUtil::SetPriority(RequestPriority priority, |
| 1314 SpdySynStreamIR* ir) const { | 1311 SpdySynStreamIR* ir) const { |
| 1315 ir->set_priority(ConvertRequestPriorityToSpdyPriority( | 1312 ir->set_priority(ConvertRequestPriorityToSpdyPriority( |
| 1316 priority, spdy_version())); | 1313 priority, spdy_version())); |
| 1317 } | 1314 } |
| 1318 | 1315 |
| 1319 } // namespace net | 1316 } // namespace net |
| OLD | NEW |