Land Recent QUIC Changes.
[chromium-blink-merge.git] / net / quic / test_tools / quic_session_peer.cc
blob7dd7b66df9d5dbe25898c54ecf0ab7c07e10807e
1 // Copyright (c) 2012 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.
5 #include "net/quic/test_tools/quic_session_peer.h"
7 #include "net/quic/quic_session.h"
8 #include "net/quic/reliable_quic_stream.h"
10 using std::map;
12 namespace net {
13 namespace test {
15 // static
16 void QuicSessionPeer::SetNextStreamId(QuicSession* session, QuicStreamId id) {
17 session->next_stream_id_ = id;
20 // static
21 void QuicSessionPeer::SetMaxOpenStreams(QuicSession* session,
22 uint32 max_streams) {
23 session->max_open_streams_ = max_streams;
26 // static
27 QuicCryptoStream* QuicSessionPeer::GetCryptoStream(QuicSession* session) {
28 return session->GetCryptoStream();
31 // static
32 QuicHeadersStream* QuicSessionPeer::GetHeadersStream(QuicSession* session) {
33 return session->headers_stream_.get();
36 // static
37 void QuicSessionPeer::SetHeadersStream(QuicSession* session,
38 QuicHeadersStream* headers_stream) {
39 session->headers_stream_.reset(headers_stream);
42 // static
43 QuicWriteBlockedList* QuicSessionPeer::GetWriteBlockedStreams(
44 QuicSession* session) {
45 return &session->write_blocked_streams_;
48 // static
49 QuicDataStream* QuicSessionPeer::GetIncomingDataStream(
50 QuicSession* session,
51 QuicStreamId stream_id) {
52 return session->GetIncomingDataStream(stream_id);
55 // static
56 map<QuicStreamId, QuicStreamOffset>&
57 QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(QuicSession* session) {
58 return session->locally_closed_streams_highest_offset_;
61 } // namespace test
62 } // namespace net