| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/quic/test_tools/quic_session_peer.h" | 5 #include "net/quic/test_tools/quic_session_peer.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "net/quic/quic_session.h" | 8 #include "net/quic/quic_session.h" |
| 9 #include "net/quic/reliable_quic_stream.h" | 9 #include "net/quic/reliable_quic_stream.h" |
| 10 | 10 |
| 11 using std::map; | 11 using std::map; |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 namespace test { | 14 namespace test { |
| 15 | 15 |
| 16 // static | 16 // static |
| 17 QuicStreamId QuicSessionPeer::GetNextOutgoingStreamId(QuicSession* session) { | 17 QuicStreamId QuicSessionPeer::GetNextOutgoingStreamId(QuicSession* session) { |
| 18 return session->GetNextOutgoingStreamId(); | 18 return session->GetNextOutgoingStreamId(); |
| 19 } | 19 } |
| 20 | 20 |
| 21 // static | 21 // static |
| 22 void QuicSessionPeer::SetNextOutgoingStreamId(QuicSession* session, | 22 void QuicSessionPeer::SetNextOutgoingStreamId(QuicSession* session, |
| 23 QuicStreamId id) { | 23 QuicStreamId id) { |
| 24 session->next_outgoing_stream_id_ = id; | 24 session->next_outgoing_stream_id_ = id; |
| 25 } | 25 } |
| 26 | 26 |
| 27 // static | 27 // static |
| 28 void QuicSessionPeer::SetMaxOpenStreams(QuicSession* session, | 28 void QuicSessionPeer::SetMaxOpenIncomingStreams(QuicSession* session, |
| 29 uint32_t max_streams) { | 29 uint32_t max_streams) { |
| 30 session->max_open_streams_ = max_streams; | 30 session->max_open_incoming_streams_ = max_streams; |
| 31 } | 31 } |
| 32 | 32 |
| 33 // static | 33 // static |
| 34 void QuicSessionPeer::SetMaxOpenOutgoingStreams(QuicSession* session, |
| 35 uint32_t max_streams) { |
| 36 session->max_open_outgoing_streams_ = max_streams; |
| 37 } |
| 38 |
| 39 // static |
| 34 QuicCryptoStream* QuicSessionPeer::GetCryptoStream(QuicSession* session) { | 40 QuicCryptoStream* QuicSessionPeer::GetCryptoStream(QuicSession* session) { |
| 35 return session->GetCryptoStream(); | 41 return session->GetCryptoStream(); |
| 36 } | 42 } |
| 37 | 43 |
| 38 // static | 44 // static |
| 39 QuicWriteBlockedList* QuicSessionPeer::GetWriteBlockedStreams( | 45 QuicWriteBlockedList* QuicSessionPeer::GetWriteBlockedStreams( |
| 40 QuicSession* session) { | 46 QuicSession* session) { |
| 41 return &session->write_blocked_streams_; | 47 return &session->write_blocked_streams_; |
| 42 } | 48 } |
| 43 | 49 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // locally-created stream. | 101 // locally-created stream. |
| 96 return id >= session->next_outgoing_stream_id_; | 102 return id >= session->next_outgoing_stream_id_; |
| 97 } else { | 103 } else { |
| 98 // peer-created stream. | 104 // peer-created stream. |
| 99 return id > session->largest_peer_created_stream_id_; | 105 return id > session->largest_peer_created_stream_id_; |
| 100 } | 106 } |
| 101 } | 107 } |
| 102 | 108 |
| 103 } // namespace test | 109 } // namespace test |
| 104 } // namespace net | 110 } // namespace net |
| OLD | NEW |