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

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: Re: comments in #5. 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
« no previous file with comments | « 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 stream_initial_recv_window_size( 371 session_max_recv_window_size(SpdySession::GetInitialWindowSize(protocol)),
372 SpdySession::GetInitialWindowSize(protocol)), 372 stream_max_recv_window_size(SpdySession::GetInitialWindowSize(protocol)),
373 time_func(&base::TimeTicks::Now), 373 time_func(&base::TimeTicks::Now),
374 force_spdy_over_ssl(false), 374 force_spdy_over_ssl(false),
375 force_spdy_always(false), 375 force_spdy_always(false),
376 use_alternate_protocols(false), 376 use_alternate_protocols(false),
377 net_log(NULL) { 377 net_log(NULL) {
378 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; 378 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol;
379 379
380 // Note: The CancelledTransaction test does cleanup by running all 380 // Note: The CancelledTransaction test does cleanup by running all
381 // tasks in the message loop (RunAllPending). Unfortunately, that 381 // tasks in the message loop (RunAllPending). Unfortunately, that
382 // doesn't clean up tasks on the host resolver thread; and 382 // doesn't clean up tasks on the host resolver thread; and
(...skipping 12 matching lines...) Expand all
395 ssl_config_service(new SSLConfigServiceDefaults), 395 ssl_config_service(new SSLConfigServiceDefaults),
396 socket_factory(new MockClientSocketFactory), 396 socket_factory(new MockClientSocketFactory),
397 deterministic_socket_factory(new DeterministicMockClientSocketFactory), 397 deterministic_socket_factory(new DeterministicMockClientSocketFactory),
398 http_auth_handler_factory( 398 http_auth_handler_factory(
399 HttpAuthHandlerFactory::CreateDefault(host_resolver.get())), 399 HttpAuthHandlerFactory::CreateDefault(host_resolver.get())),
400 enable_ip_pooling(true), 400 enable_ip_pooling(true),
401 enable_compression(false), 401 enable_compression(false),
402 enable_ping(false), 402 enable_ping(false),
403 enable_user_alternate_protocol_ports(false), 403 enable_user_alternate_protocol_ports(false),
404 protocol(protocol), 404 protocol(protocol),
405 stream_initial_recv_window_size( 405 session_max_recv_window_size(SpdySession::GetInitialWindowSize(protocol)),
406 SpdySession::GetInitialWindowSize(protocol)), 406 stream_max_recv_window_size(SpdySession::GetInitialWindowSize(protocol)),
407 time_func(&base::TimeTicks::Now), 407 time_func(&base::TimeTicks::Now),
408 force_spdy_over_ssl(false), 408 force_spdy_over_ssl(false),
409 force_spdy_always(false), 409 force_spdy_always(false),
410 use_alternate_protocols(false), 410 use_alternate_protocols(false),
411 net_log(NULL) { 411 net_log(NULL) {
412 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; 412 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol;
413 } 413 }
414 414
415 SpdySessionDependencies::~SpdySessionDependencies() {} 415 SpdySessionDependencies::~SpdySessionDependencies() {}
416 416
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 params.ssl_config_service = session_deps->ssl_config_service.get(); 452 params.ssl_config_service = session_deps->ssl_config_service.get();
453 params.http_auth_handler_factory = 453 params.http_auth_handler_factory =
454 session_deps->http_auth_handler_factory.get(); 454 session_deps->http_auth_handler_factory.get();
455 params.http_server_properties = 455 params.http_server_properties =
456 session_deps->http_server_properties.GetWeakPtr(); 456 session_deps->http_server_properties.GetWeakPtr();
457 params.enable_spdy_compression = session_deps->enable_compression; 457 params.enable_spdy_compression = session_deps->enable_compression;
458 params.enable_spdy_ping_based_connection_checking = session_deps->enable_ping; 458 params.enable_spdy_ping_based_connection_checking = session_deps->enable_ping;
459 params.enable_user_alternate_protocol_ports = 459 params.enable_user_alternate_protocol_ports =
460 session_deps->enable_user_alternate_protocol_ports; 460 session_deps->enable_user_alternate_protocol_ports;
461 params.spdy_default_protocol = session_deps->protocol; 461 params.spdy_default_protocol = session_deps->protocol;
462 params.spdy_stream_initial_recv_window_size = 462 params.spdy_session_max_recv_window_size =
463 session_deps->stream_initial_recv_window_size; 463 session_deps->session_max_recv_window_size;
464 params.spdy_stream_max_recv_window_size =
465 session_deps->stream_max_recv_window_size;
464 params.time_func = session_deps->time_func; 466 params.time_func = session_deps->time_func;
465 params.next_protos = session_deps->next_protos; 467 params.next_protos = session_deps->next_protos;
466 params.trusted_spdy_proxy = session_deps->trusted_spdy_proxy; 468 params.trusted_spdy_proxy = session_deps->trusted_spdy_proxy;
467 params.force_spdy_over_ssl = session_deps->force_spdy_over_ssl; 469 params.force_spdy_over_ssl = session_deps->force_spdy_over_ssl;
468 params.force_spdy_always = session_deps->force_spdy_always; 470 params.force_spdy_always = session_deps->force_spdy_always;
469 params.use_alternate_protocols = session_deps->use_alternate_protocols; 471 params.use_alternate_protocols = session_deps->use_alternate_protocols;
470 params.net_log = session_deps->net_log; 472 params.net_log = session_deps->net_log;
471 return params; 473 return params;
472 } 474 }
473 475
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 } 708 }
707 709
708 void SpdySessionPoolPeer::DisableDomainAuthenticationVerification() { 710 void SpdySessionPoolPeer::DisableDomainAuthenticationVerification() {
709 pool_->verify_domain_authentication_ = false; 711 pool_->verify_domain_authentication_ = false;
710 } 712 }
711 713
712 void SpdySessionPoolPeer::SetEnableSendingInitialData(bool enabled) { 714 void SpdySessionPoolPeer::SetEnableSendingInitialData(bool enabled) {
713 pool_->enable_sending_initial_data_ = enabled; 715 pool_->enable_sending_initial_data_ = enabled;
714 } 716 }
715 717
718 void SpdySessionPoolPeer::SetSessionMaxRecvWindowSize(size_t window) {
719 pool_->session_max_recv_window_size_ = window;
720 }
721
722 void SpdySessionPoolPeer::SetStreamInitialRecvWindowSize(size_t window) {
723 pool_->stream_max_recv_window_size_ = window;
724 }
725
716 SpdyTestUtil::SpdyTestUtil(NextProto protocol) 726 SpdyTestUtil::SpdyTestUtil(NextProto protocol)
717 : protocol_(protocol), 727 : protocol_(protocol),
718 spdy_version_(NextProtoToSpdyMajorVersion(protocol)) { 728 spdy_version_(NextProtoToSpdyMajorVersion(protocol)) {
719 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; 729 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol;
720 } 730 }
721 731
722 void SpdyTestUtil::AddUrlToHeaderBlock(base::StringPiece url, 732 void SpdyTestUtil::AddUrlToHeaderBlock(base::StringPiece url,
723 SpdyHeaderBlock* headers) const { 733 SpdyHeaderBlock* headers) const {
724 std::string scheme, host, path; 734 std::string scheme, host, path;
725 ParseUrl(url, &scheme, &host, &path); 735 ParseUrl(url, &scheme, &host, &path);
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 } 1338 }
1329 } 1339 }
1330 1340
1331 void SpdyTestUtil::SetPriority(RequestPriority priority, 1341 void SpdyTestUtil::SetPriority(RequestPriority priority,
1332 SpdySynStreamIR* ir) const { 1342 SpdySynStreamIR* ir) const {
1333 ir->set_priority(ConvertRequestPriorityToSpdyPriority( 1343 ir->set_priority(ConvertRequestPriorityToSpdyPriority(
1334 priority, spdy_version())); 1344 priority, spdy_version()));
1335 } 1345 }
1336 1346
1337 } // namespace net 1347 } // namespace net
OLDNEW
« no previous file with comments | « 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