QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 1 | // Copyright (c) 2018 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 | #ifndef QUICHE_QUIC_TEST_TOOLS_QUIC_SERVER_SESSION_BASE_PEER_H_ |
| 6 | #define QUICHE_QUIC_TEST_TOOLS_QUIC_SERVER_SESSION_BASE_PEER_H_ |
| 7 | |
| 8 | #include "net/third_party/quiche/src/quic/core/http/quic_server_session_base.h" |
| 9 | |
| 10 | #include "net/third_party/quiche/src/quic/core/quic_utils.h" |
| 11 | |
| 12 | namespace quic { |
| 13 | namespace test { |
| 14 | |
| 15 | class QuicServerSessionBasePeer { |
| 16 | public: |
| 17 | static QuicStream* GetOrCreateDynamicStream(QuicServerSessionBase* s, |
| 18 | QuicStreamId id) { |
| 19 | return s->GetOrCreateDynamicStream(id); |
| 20 | } |
| 21 | static void SetCryptoStream(QuicServerSessionBase* s, |
| 22 | QuicCryptoServerStream* crypto_stream) { |
| 23 | s->crypto_stream_.reset(crypto_stream); |
| 24 | s->RegisterStaticStream( |
| 25 | QuicUtils::GetCryptoStreamId(s->connection()->transport_version()), |
| 26 | crypto_stream); |
| 27 | } |
| 28 | static bool IsBandwidthResumptionEnabled(QuicServerSessionBase* s) { |
| 29 | return s->bandwidth_resumption_enabled_; |
| 30 | } |
| 31 | }; |
| 32 | |
| 33 | } // namespace test |
| 34 | |
| 35 | } // namespace quic |
| 36 | |
| 37 | #endif // QUICHE_QUIC_TEST_TOOLS_QUIC_SERVER_SESSION_BASE_PEER_H_ |