QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "net/third_party/quiche/src/quic/test_tools/quic_config_peer.h" |
| 6 | |
| 7 | #include "net/third_party/quiche/src/quic/core/quic_config.h" |
| 8 | |
| 9 | namespace quic { |
| 10 | namespace test { |
| 11 | |
| 12 | // static |
| 13 | void QuicConfigPeer::SetReceivedInitialStreamFlowControlWindow( |
| 14 | QuicConfig* config, |
| 15 | uint32_t window_bytes) { |
| 16 | config->initial_stream_flow_control_window_bytes_.SetReceivedValue( |
| 17 | window_bytes); |
| 18 | } |
| 19 | |
| 20 | // static |
| 21 | void QuicConfigPeer::SetReceivedInitialSessionFlowControlWindow( |
| 22 | QuicConfig* config, |
| 23 | uint32_t window_bytes) { |
| 24 | config->initial_session_flow_control_window_bytes_.SetReceivedValue( |
| 25 | window_bytes); |
| 26 | } |
| 27 | |
| 28 | // static |
| 29 | void QuicConfigPeer::SetReceivedConnectionOptions( |
| 30 | QuicConfig* config, |
| 31 | const QuicTagVector& options) { |
| 32 | config->connection_options_.SetReceivedValues(options); |
| 33 | } |
| 34 | |
| 35 | // static |
| 36 | void QuicConfigPeer::SetReceivedBytesForConnectionId(QuicConfig* config, |
| 37 | uint32_t bytes) { |
| 38 | DCHECK(bytes == 0 || bytes == 8); |
| 39 | config->bytes_for_connection_id_.SetReceivedValue(bytes); |
| 40 | } |
| 41 | |
| 42 | // static |
| 43 | void QuicConfigPeer::SetReceivedDisableConnectionMigration(QuicConfig* config) { |
| 44 | config->connection_migration_disabled_.SetReceivedValue(1); |
| 45 | } |
| 46 | |
| 47 | // static |
| 48 | void QuicConfigPeer::SetReceivedMaxIncomingDynamicStreams( |
| 49 | QuicConfig* config, |
| 50 | uint32_t max_streams) { |
| 51 | config->max_incoming_dynamic_streams_.SetReceivedValue(max_streams); |
| 52 | } |
| 53 | |
| 54 | // static |
| 55 | void QuicConfigPeer::SetConnectionOptionsToSend(QuicConfig* config, |
| 56 | const QuicTagVector& options) { |
| 57 | config->SetConnectionOptionsToSend(options); |
| 58 | } |
| 59 | |
| 60 | // static |
| 61 | void QuicConfigPeer::SetReceivedStatelessResetToken(QuicConfig* config, |
| 62 | QuicUint128 token) { |
| 63 | config->stateless_reset_token_.SetReceivedValue(token); |
| 64 | } |
| 65 | |
| 66 | } // namespace test |
| 67 | } // namespace quic |