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 #ifndef NET_QUIC_TEST_TOOLS_QUIC_SESSION_PEER_H_ | 5 #ifndef NET_QUIC_TEST_TOOLS_QUIC_SESSION_PEER_H_ |
6 #define NET_QUIC_TEST_TOOLS_QUIC_SESSION_PEER_H_ | 6 #define NET_QUIC_TEST_TOOLS_QUIC_SESSION_PEER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 11 matching lines...) Expand all Loading... |
22 class QuicSession; | 22 class QuicSession; |
23 class QuicSpdyStream; | 23 class QuicSpdyStream; |
24 class ReliableQuicStream; | 24 class ReliableQuicStream; |
25 | 25 |
26 namespace test { | 26 namespace test { |
27 | 27 |
28 class QuicSessionPeer { | 28 class QuicSessionPeer { |
29 public: | 29 public: |
30 static QuicStreamId GetNextOutgoingStreamId(QuicSession* session); | 30 static QuicStreamId GetNextOutgoingStreamId(QuicSession* session); |
31 static void SetNextOutgoingStreamId(QuicSession* session, QuicStreamId id); | 31 static void SetNextOutgoingStreamId(QuicSession* session, QuicStreamId id); |
32 static void SetMaxOpenStreams(QuicSession* session, uint32_t max_streams); | 32 static void SetMaxOpenIncomingStreams(QuicSession* session, |
| 33 uint32_t max_streams); |
| 34 static void SetMaxOpenOutgoingStreams(QuicSession* session, |
| 35 uint32_t max_streams); |
33 static QuicCryptoStream* GetCryptoStream(QuicSession* session); | 36 static QuicCryptoStream* GetCryptoStream(QuicSession* session); |
34 static QuicWriteBlockedList* GetWriteBlockedStreams(QuicSession* session); | 37 static QuicWriteBlockedList* GetWriteBlockedStreams(QuicSession* session); |
35 static ReliableQuicStream* GetOrCreateDynamicStream(QuicSession* session, | 38 static ReliableQuicStream* GetOrCreateDynamicStream(QuicSession* session, |
36 QuicStreamId stream_id); | 39 QuicStreamId stream_id); |
37 static std::map<QuicStreamId, QuicStreamOffset>& | 40 static std::map<QuicStreamId, QuicStreamOffset>& |
38 GetLocallyClosedStreamsHighestOffset(QuicSession* session); | 41 GetLocallyClosedStreamsHighestOffset(QuicSession* session); |
39 static QuicSession::StreamMap& static_streams(QuicSession* session); | 42 static QuicSession::StreamMap& static_streams(QuicSession* session); |
40 static QuicSession::StreamMap& dynamic_streams(QuicSession* session); | 43 static QuicSession::StreamMap& dynamic_streams(QuicSession* session); |
41 static base::hash_set<QuicStreamId>* GetDrainingStreams(QuicSession* session); | 44 static base::hash_set<QuicStreamId>* GetDrainingStreams(QuicSession* session); |
42 | 45 |
43 // Discern the state of a stream. Exactly one of these should be true at a | 46 // Discern the state of a stream. Exactly one of these should be true at a |
44 // time for any stream id > 0 (other than the special streams 1 and 3). | 47 // time for any stream id > 0 (other than the special streams 1 and 3). |
45 static bool IsStreamClosed(QuicSession* session, QuicStreamId id); | 48 static bool IsStreamClosed(QuicSession* session, QuicStreamId id); |
46 static bool IsStreamCreated(QuicSession* session, QuicStreamId id); | 49 static bool IsStreamCreated(QuicSession* session, QuicStreamId id); |
47 static bool IsStreamAvailable(QuicSession* session, QuicStreamId id); | 50 static bool IsStreamAvailable(QuicSession* session, QuicStreamId id); |
48 static bool IsStreamUncreated(QuicSession* session, QuicStreamId id); | 51 static bool IsStreamUncreated(QuicSession* session, QuicStreamId id); |
49 | 52 |
50 private: | 53 private: |
51 DISALLOW_COPY_AND_ASSIGN(QuicSessionPeer); | 54 DISALLOW_COPY_AND_ASSIGN(QuicSessionPeer); |
52 }; | 55 }; |
53 | 56 |
54 } // namespace test | 57 } // namespace test |
55 | 58 |
56 } // namespace net | 59 } // namespace net |
57 | 60 |
58 #endif // NET_QUIC_TEST_TOOLS_QUIC_SESSION_PEER_H_ | 61 #endif // NET_QUIC_TEST_TOOLS_QUIC_SESSION_PEER_H_ |
OLD | NEW |