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 <cstddef> | 7 #include <cstddef> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 enable_ip_pooling(true), | 367 enable_ip_pooling(true), |
368 enable_compression(false), | 368 enable_compression(false), |
369 enable_ping(false), | 369 enable_ping(false), |
370 enable_user_alternate_protocol_ports(false), | 370 enable_user_alternate_protocol_ports(false), |
371 protocol(protocol), | 371 protocol(protocol), |
372 session_max_recv_window_size( | 372 session_max_recv_window_size( |
373 SpdySession::GetDefaultInitialWindowSize(protocol)), | 373 SpdySession::GetDefaultInitialWindowSize(protocol)), |
374 stream_max_recv_window_size( | 374 stream_max_recv_window_size( |
375 SpdySession::GetDefaultInitialWindowSize(protocol)), | 375 SpdySession::GetDefaultInitialWindowSize(protocol)), |
376 time_func(&base::TimeTicks::Now), | 376 time_func(&base::TimeTicks::Now), |
377 use_alternate_protocols(false), | 377 use_alternative_services(false), |
378 net_log(NULL) { | 378 net_log(NULL) { |
379 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; | 379 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; |
380 | 380 |
381 // Note: The CancelledTransaction test does cleanup by running all | 381 // Note: The CancelledTransaction test does cleanup by running all |
382 // tasks in the message loop (RunAllPending). Unfortunately, that | 382 // tasks in the message loop (RunAllPending). Unfortunately, that |
383 // doesn't clean up tasks on the host resolver thread; and | 383 // doesn't clean up tasks on the host resolver thread; and |
384 // TCPConnectJob is currently not cancellable. Using synchronous | 384 // TCPConnectJob is currently not cancellable. Using synchronous |
385 // lookups allows the test to shutdown cleanly. Until we have | 385 // lookups allows the test to shutdown cleanly. Until we have |
386 // cancellable TCPConnectJobs, use synchronous lookups. | 386 // cancellable TCPConnectJobs, use synchronous lookups. |
387 host_resolver->set_synchronous_mode(true); | 387 host_resolver->set_synchronous_mode(true); |
(...skipping 13 matching lines...) Expand all Loading... |
401 enable_ip_pooling(true), | 401 enable_ip_pooling(true), |
402 enable_compression(false), | 402 enable_compression(false), |
403 enable_ping(false), | 403 enable_ping(false), |
404 enable_user_alternate_protocol_ports(false), | 404 enable_user_alternate_protocol_ports(false), |
405 protocol(protocol), | 405 protocol(protocol), |
406 session_max_recv_window_size( | 406 session_max_recv_window_size( |
407 SpdySession::GetDefaultInitialWindowSize(protocol)), | 407 SpdySession::GetDefaultInitialWindowSize(protocol)), |
408 stream_max_recv_window_size( | 408 stream_max_recv_window_size( |
409 SpdySession::GetDefaultInitialWindowSize(protocol)), | 409 SpdySession::GetDefaultInitialWindowSize(protocol)), |
410 time_func(&base::TimeTicks::Now), | 410 time_func(&base::TimeTicks::Now), |
411 use_alternate_protocols(false), | 411 use_alternative_services(true), |
412 net_log(NULL) { | 412 net_log(NULL) { |
413 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; | 413 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; |
414 } | 414 } |
415 | 415 |
416 SpdySessionDependencies::~SpdySessionDependencies() {} | 416 SpdySessionDependencies::~SpdySessionDependencies() {} |
417 | 417 |
418 // static | 418 // static |
419 HttpNetworkSession* SpdySessionDependencies::SpdyCreateSession( | 419 HttpNetworkSession* SpdySessionDependencies::SpdyCreateSession( |
420 SpdySessionDependencies* session_deps) { | 420 SpdySessionDependencies* session_deps) { |
421 HttpNetworkSession::Params params = CreateSessionParams(session_deps); | 421 HttpNetworkSession::Params params = CreateSessionParams(session_deps); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 params.enable_user_alternate_protocol_ports = | 460 params.enable_user_alternate_protocol_ports = |
461 session_deps->enable_user_alternate_protocol_ports; | 461 session_deps->enable_user_alternate_protocol_ports; |
462 params.spdy_default_protocol = session_deps->protocol; | 462 params.spdy_default_protocol = session_deps->protocol; |
463 params.spdy_session_max_recv_window_size = | 463 params.spdy_session_max_recv_window_size = |
464 session_deps->session_max_recv_window_size; | 464 session_deps->session_max_recv_window_size; |
465 params.spdy_stream_max_recv_window_size = | 465 params.spdy_stream_max_recv_window_size = |
466 session_deps->stream_max_recv_window_size; | 466 session_deps->stream_max_recv_window_size; |
467 params.time_func = session_deps->time_func; | 467 params.time_func = session_deps->time_func; |
468 params.next_protos = session_deps->next_protos; | 468 params.next_protos = session_deps->next_protos; |
469 params.trusted_spdy_proxy = session_deps->trusted_spdy_proxy; | 469 params.trusted_spdy_proxy = session_deps->trusted_spdy_proxy; |
470 params.use_alternate_protocols = session_deps->use_alternate_protocols; | 470 params.use_alternative_services = session_deps->use_alternative_services; |
471 params.net_log = session_deps->net_log; | 471 params.net_log = session_deps->net_log; |
472 return params; | 472 return params; |
473 } | 473 } |
474 | 474 |
475 SpdyURLRequestContext::SpdyURLRequestContext(NextProto protocol) | 475 SpdyURLRequestContext::SpdyURLRequestContext(NextProto protocol) |
476 : storage_(this) { | 476 : storage_(this) { |
477 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; | 477 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; |
478 | 478 |
479 storage_.set_host_resolver(scoped_ptr<HostResolver>(new MockHostResolver)); | 479 storage_.set_host_resolver(scoped_ptr<HostResolver>(new MockHostResolver)); |
480 storage_.set_cert_verifier(new MockCertVerifier); | 480 storage_.set_cert_verifier(new MockCertVerifier); |
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1339 } | 1339 } |
1340 } | 1340 } |
1341 | 1341 |
1342 void SpdyTestUtil::SetPriority(RequestPriority priority, | 1342 void SpdyTestUtil::SetPriority(RequestPriority priority, |
1343 SpdySynStreamIR* ir) const { | 1343 SpdySynStreamIR* ir) const { |
1344 ir->set_priority(ConvertRequestPriorityToSpdyPriority( | 1344 ir->set_priority(ConvertRequestPriorityToSpdyPriority( |
1345 priority, spdy_version())); | 1345 priority, spdy_version())); |
1346 } | 1346 } |
1347 | 1347 |
1348 } // namespace net | 1348 } // namespace net |
OLD | NEW |