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. 4 5 #include "net/quic/test_tools/quic_session_peer.h" 6 7 #include "net/quic/quic_session.h" 8 #include "net/quic/reliable_quic_stream.h" 9 10 namespace net { 11 namespace test { 12 13 // static SetNextStreamId(QuicSession * session,QuicStreamId id)14void QuicSessionPeer::SetNextStreamId(QuicSession* session, QuicStreamId id) { 15 session->next_stream_id_ = id; 16 } 17 18 // static SetMaxOpenStreams(QuicSession * session,uint32 max_streams)19void QuicSessionPeer::SetMaxOpenStreams(QuicSession* session, 20 uint32 max_streams) { 21 session->max_open_streams_ = max_streams; 22 } 23 24 // static GetCryptoStream(QuicSession * session)25QuicCryptoStream* QuicSessionPeer::GetCryptoStream(QuicSession* session) { 26 return session->GetCryptoStream(); 27 } 28 29 // static GetHeadersStream(QuicSession * session)30QuicHeadersStream* QuicSessionPeer::GetHeadersStream(QuicSession* session) { 31 return session->headers_stream_.get(); 32 } 33 34 // static SetHeadersStream(QuicSession * session,QuicHeadersStream * headers_stream)35void QuicSessionPeer::SetHeadersStream(QuicSession* session, 36 QuicHeadersStream* headers_stream) { 37 session->headers_stream_.reset(headers_stream); 38 } 39 40 // static GetWriteBlockedStreams(QuicSession * session)41QuicWriteBlockedList* QuicSessionPeer::GetWriteBlockedStreams( 42 QuicSession* session) { 43 return &session->write_blocked_streams_; 44 } 45 46 // static GetIncomingDataStream(QuicSession * session,QuicStreamId stream_id)47QuicDataStream* QuicSessionPeer::GetIncomingDataStream( 48 QuicSession* session, 49 QuicStreamId stream_id) { 50 return session->GetIncomingDataStream(stream_id); 51 } 52 53 // static 54 map<QuicStreamId, QuicStreamOffset>& GetLocallyClosedStreamsHighestOffset(QuicSession * session)55QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(QuicSession* session) { 56 return session->locally_closed_streams_highest_offset_; 57 } 58 59 } // namespace test 60 } // namespace net 61