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 <map> | 8 #include <map> |
9 | 9 |
10 #include "net/quic/quic_protocol.h" | 10 #include "net/quic/quic_protocol.h" |
11 #include "net/quic/quic_write_blocked_list.h" | 11 #include "net/quic/quic_write_blocked_list.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 class QuicCryptoStream; | 15 class QuicCryptoStream; |
16 class QuicDataStream; | 16 class QuicDataStream; |
17 class QuicHeadersStream; | 17 class QuicHeadersStream; |
18 class QuicSession; | 18 class QuicSession; |
| 19 class ReliableQuicStream; |
19 | 20 |
20 namespace test { | 21 namespace test { |
21 | 22 |
22 class QuicSessionPeer { | 23 class QuicSessionPeer { |
23 public: | 24 public: |
24 static void SetNextStreamId(QuicSession* session, QuicStreamId id); | 25 static void SetNextStreamId(QuicSession* session, QuicStreamId id); |
25 static void SetMaxOpenStreams(QuicSession* session, uint32 max_streams); | 26 static void SetMaxOpenStreams(QuicSession* session, uint32 max_streams); |
26 static QuicCryptoStream* GetCryptoStream(QuicSession* session); | 27 static QuicCryptoStream* GetCryptoStream(QuicSession* session); |
27 static QuicHeadersStream* GetHeadersStream(QuicSession* session); | |
28 static void SetHeadersStream(QuicSession* session, | |
29 QuicHeadersStream* headers_stream); | |
30 static QuicWriteBlockedList* GetWriteBlockedStreams(QuicSession* session); | 28 static QuicWriteBlockedList* GetWriteBlockedStreams(QuicSession* session); |
31 static QuicDataStream* GetIncomingDataStream(QuicSession* session, | 29 static ReliableQuicStream* GetIncomingDynamicStream(QuicSession* session, |
32 QuicStreamId stream_id); | 30 QuicStreamId stream_id); |
33 static std::map<QuicStreamId, QuicStreamOffset>& | 31 static std::map<QuicStreamId, QuicStreamOffset>& |
34 GetLocallyClosedStreamsHighestOffset(QuicSession* session); | 32 GetLocallyClosedStreamsHighestOffset(QuicSession* session); |
35 | 33 |
36 // Discern the state of a stream. Exactly one of these should be true at a | 34 // Discern the state of a stream. Exactly one of these should be true at a |
37 // time for any stream id > 0 (other than the special streams 1 and 3). | 35 // time for any stream id > 0 (other than the special streams 1 and 3). |
38 static bool IsStreamClosed(QuicSession* session, QuicStreamId id); | 36 static bool IsStreamClosed(QuicSession* session, QuicStreamId id); |
39 static bool IsStreamCreated(QuicSession* session, QuicStreamId id); | 37 static bool IsStreamCreated(QuicSession* session, QuicStreamId id); |
40 static bool IsStreamImplicitlyCreated(QuicSession* session, QuicStreamId id); | 38 static bool IsStreamImplicitlyCreated(QuicSession* session, QuicStreamId id); |
41 static bool IsStreamUncreated(QuicSession* session, QuicStreamId id); | 39 static bool IsStreamUncreated(QuicSession* session, QuicStreamId id); |
42 | 40 |
43 private: | 41 private: |
44 DISALLOW_COPY_AND_ASSIGN(QuicSessionPeer); | 42 DISALLOW_COPY_AND_ASSIGN(QuicSessionPeer); |
45 }; | 43 }; |
46 | 44 |
47 } // namespace test | 45 } // namespace test |
48 } // namespace net | 46 } // namespace net |
49 | 47 |
50 #endif // NET_QUIC_TEST_TOOLS_QUIC_SESSION_PEER_H_ | 48 #endif // NET_QUIC_TEST_TOOLS_QUIC_SESSION_PEER_H_ |
OLD | NEW |