Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Side by Side Diff: net/spdy/spdy_test_util_common.cc

Issue 1061853002: Emit session-level WINDOW_UPDATEs less frequently. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test and loads of plumbing. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« net/spdy/spdy_session.h ('K') | « net/spdy/spdy_test_util_common.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 ssl_config_service(new SSLConfigServiceDefaults), 361 ssl_config_service(new SSLConfigServiceDefaults),
362 socket_factory(new MockClientSocketFactory), 362 socket_factory(new MockClientSocketFactory),
363 deterministic_socket_factory(new DeterministicMockClientSocketFactory), 363 deterministic_socket_factory(new DeterministicMockClientSocketFactory),
364 http_auth_handler_factory( 364 http_auth_handler_factory(
365 HttpAuthHandlerFactory::CreateDefault(host_resolver.get())), 365 HttpAuthHandlerFactory::CreateDefault(host_resolver.get())),
366 enable_ip_pooling(true), 366 enable_ip_pooling(true),
367 enable_compression(false), 367 enable_compression(false),
368 enable_ping(false), 368 enable_ping(false),
369 enable_user_alternate_protocol_ports(false), 369 enable_user_alternate_protocol_ports(false),
370 protocol(protocol), 370 protocol(protocol),
371 session_max_recv_window_size(SpdySession::GetInitialWindowSize(protocol)),
371 stream_initial_recv_window_size( 372 stream_initial_recv_window_size(
372 SpdySession::GetInitialWindowSize(protocol)), 373 SpdySession::GetInitialWindowSize(protocol)),
373 time_func(&base::TimeTicks::Now), 374 time_func(&base::TimeTicks::Now),
374 force_spdy_over_ssl(false), 375 force_spdy_over_ssl(false),
375 force_spdy_always(false), 376 force_spdy_always(false),
376 use_alternate_protocols(false), 377 use_alternate_protocols(false),
377 net_log(NULL) { 378 net_log(NULL) {
378 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; 379 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol;
379 380
380 // Note: The CancelledTransaction test does cleanup by running all 381 // Note: The CancelledTransaction test does cleanup by running all
(...skipping 14 matching lines...) Expand all
395 ssl_config_service(new SSLConfigServiceDefaults), 396 ssl_config_service(new SSLConfigServiceDefaults),
396 socket_factory(new MockClientSocketFactory), 397 socket_factory(new MockClientSocketFactory),
397 deterministic_socket_factory(new DeterministicMockClientSocketFactory), 398 deterministic_socket_factory(new DeterministicMockClientSocketFactory),
398 http_auth_handler_factory( 399 http_auth_handler_factory(
399 HttpAuthHandlerFactory::CreateDefault(host_resolver.get())), 400 HttpAuthHandlerFactory::CreateDefault(host_resolver.get())),
400 enable_ip_pooling(true), 401 enable_ip_pooling(true),
401 enable_compression(false), 402 enable_compression(false),
402 enable_ping(false), 403 enable_ping(false),
403 enable_user_alternate_protocol_ports(false), 404 enable_user_alternate_protocol_ports(false),
404 protocol(protocol), 405 protocol(protocol),
406 session_max_recv_window_size(SpdySession::GetInitialWindowSize(protocol)),
405 stream_initial_recv_window_size( 407 stream_initial_recv_window_size(
406 SpdySession::GetInitialWindowSize(protocol)), 408 SpdySession::GetInitialWindowSize(protocol)),
407 time_func(&base::TimeTicks::Now), 409 time_func(&base::TimeTicks::Now),
408 force_spdy_over_ssl(false), 410 force_spdy_over_ssl(false),
409 force_spdy_always(false), 411 force_spdy_always(false),
410 use_alternate_protocols(false), 412 use_alternate_protocols(false),
411 net_log(NULL) { 413 net_log(NULL) {
412 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; 414 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol;
413 } 415 }
414 416
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 params.ssl_config_service = session_deps->ssl_config_service.get(); 454 params.ssl_config_service = session_deps->ssl_config_service.get();
453 params.http_auth_handler_factory = 455 params.http_auth_handler_factory =
454 session_deps->http_auth_handler_factory.get(); 456 session_deps->http_auth_handler_factory.get();
455 params.http_server_properties = 457 params.http_server_properties =
456 session_deps->http_server_properties.GetWeakPtr(); 458 session_deps->http_server_properties.GetWeakPtr();
457 params.enable_spdy_compression = session_deps->enable_compression; 459 params.enable_spdy_compression = session_deps->enable_compression;
458 params.enable_spdy_ping_based_connection_checking = session_deps->enable_ping; 460 params.enable_spdy_ping_based_connection_checking = session_deps->enable_ping;
459 params.enable_user_alternate_protocol_ports = 461 params.enable_user_alternate_protocol_ports =
460 session_deps->enable_user_alternate_protocol_ports; 462 session_deps->enable_user_alternate_protocol_ports;
461 params.spdy_default_protocol = session_deps->protocol; 463 params.spdy_default_protocol = session_deps->protocol;
464 params.spdy_session_max_recv_window_size =
465 session_deps->session_max_recv_window_size;
462 params.spdy_stream_initial_recv_window_size = 466 params.spdy_stream_initial_recv_window_size =
463 session_deps->stream_initial_recv_window_size; 467 session_deps->stream_initial_recv_window_size;
464 params.time_func = session_deps->time_func; 468 params.time_func = session_deps->time_func;
465 params.next_protos = session_deps->next_protos; 469 params.next_protos = session_deps->next_protos;
466 params.trusted_spdy_proxy = session_deps->trusted_spdy_proxy; 470 params.trusted_spdy_proxy = session_deps->trusted_spdy_proxy;
467 params.force_spdy_over_ssl = session_deps->force_spdy_over_ssl; 471 params.force_spdy_over_ssl = session_deps->force_spdy_over_ssl;
468 params.force_spdy_always = session_deps->force_spdy_always; 472 params.force_spdy_always = session_deps->force_spdy_always;
469 params.use_alternate_protocols = session_deps->use_alternate_protocols; 473 params.use_alternate_protocols = session_deps->use_alternate_protocols;
470 params.net_log = session_deps->net_log; 474 params.net_log = session_deps->net_log;
471 return params; 475 return params;
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 } 710 }
707 711
708 void SpdySessionPoolPeer::DisableDomainAuthenticationVerification() { 712 void SpdySessionPoolPeer::DisableDomainAuthenticationVerification() {
709 pool_->verify_domain_authentication_ = false; 713 pool_->verify_domain_authentication_ = false;
710 } 714 }
711 715
712 void SpdySessionPoolPeer::SetEnableSendingInitialData(bool enabled) { 716 void SpdySessionPoolPeer::SetEnableSendingInitialData(bool enabled) {
713 pool_->enable_sending_initial_data_ = enabled; 717 pool_->enable_sending_initial_data_ = enabled;
714 } 718 }
715 719
720 void SpdySessionPoolPeer::SetSessionMaxRecvWindowSize(size_t window) {
721 pool_->session_max_recv_window_size_ = window;
722 }
723
724 void SpdySessionPoolPeer::SetStreamInitialRecvWindowSize(size_t window) {
725 pool_->stream_initial_recv_window_size_ = window;
726 }
727
716 SpdyTestUtil::SpdyTestUtil(NextProto protocol) 728 SpdyTestUtil::SpdyTestUtil(NextProto protocol)
717 : protocol_(protocol), 729 : protocol_(protocol),
718 spdy_version_(NextProtoToSpdyMajorVersion(protocol)) { 730 spdy_version_(NextProtoToSpdyMajorVersion(protocol)) {
719 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; 731 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol;
720 } 732 }
721 733
722 void SpdyTestUtil::AddUrlToHeaderBlock(base::StringPiece url, 734 void SpdyTestUtil::AddUrlToHeaderBlock(base::StringPiece url,
723 SpdyHeaderBlock* headers) const { 735 SpdyHeaderBlock* headers) const {
724 std::string scheme, host, path; 736 std::string scheme, host, path;
725 ParseUrl(url, &scheme, &host, &path); 737 ParseUrl(url, &scheme, &host, &path);
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 } 1340 }
1329 } 1341 }
1330 1342
1331 void SpdyTestUtil::SetPriority(RequestPriority priority, 1343 void SpdyTestUtil::SetPriority(RequestPriority priority,
1332 SpdySynStreamIR* ir) const { 1344 SpdySynStreamIR* ir) const {
1333 ir->set_priority(ConvertRequestPriorityToSpdyPriority( 1345 ir->set_priority(ConvertRequestPriorityToSpdyPriority(
1334 priority, spdy_version())); 1346 priority, spdy_version()));
1335 } 1347 }
1336 1348
1337 } // namespace net 1349 } // namespace net
OLDNEW
« net/spdy/spdy_session.h ('K') | « net/spdy/spdy_test_util_common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698