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