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_RELIABLE_QUIC_STREAM_PEER_H_ | 5 #ifndef NET_QUIC_TEST_TOOLS_RELIABLE_QUIC_STREAM_PEER_H_ |
6 #define NET_QUIC_TEST_TOOLS_RELIABLE_QUIC_STREAM_PEER_H_ | 6 #define NET_QUIC_TEST_TOOLS_RELIABLE_QUIC_STREAM_PEER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
9 #include "base/strings/string_piece.h" | 11 #include "base/strings/string_piece.h" |
10 #include "net/quic/quic_protocol.h" | 12 #include "net/quic/quic_protocol.h" |
11 | 13 |
12 namespace net { | 14 namespace net { |
13 | 15 |
14 class ReliableQuicStream; | 16 class ReliableQuicStream; |
15 | 17 |
16 namespace test { | 18 namespace test { |
17 | 19 |
18 class ReliableQuicStreamPeer { | 20 class ReliableQuicStreamPeer { |
19 public: | 21 public: |
20 static void SetWriteSideClosed(bool value, ReliableQuicStream* stream); | 22 static void SetWriteSideClosed(bool value, ReliableQuicStream* stream); |
21 static void SetStreamBytesWritten(QuicStreamOffset stream_bytes_written, | 23 static void SetStreamBytesWritten(QuicStreamOffset stream_bytes_written, |
22 ReliableQuicStream* stream); | 24 ReliableQuicStream* stream); |
23 static bool read_side_closed(ReliableQuicStream* stream); | 25 static bool read_side_closed(ReliableQuicStream* stream); |
24 static void CloseReadSide(ReliableQuicStream* stream); | 26 static void CloseReadSide(ReliableQuicStream* stream); |
25 | 27 |
26 static bool FinSent(ReliableQuicStream* stream); | 28 static bool FinSent(ReliableQuicStream* stream); |
27 static bool FinReceived(ReliableQuicStream* stream); | 29 static bool FinReceived(ReliableQuicStream* stream); |
28 static bool RstSent(ReliableQuicStream* stream); | 30 static bool RstSent(ReliableQuicStream* stream); |
29 static bool RstReceived(ReliableQuicStream* stream); | 31 static bool RstReceived(ReliableQuicStream* stream); |
30 | 32 |
31 static bool ReadSideClosed(ReliableQuicStream* stream); | 33 static bool ReadSideClosed(ReliableQuicStream* stream); |
32 static bool WriteSideClosed(ReliableQuicStream* stream); | 34 static bool WriteSideClosed(ReliableQuicStream* stream); |
33 | 35 |
34 static uint32 SizeOfQueuedData(ReliableQuicStream* stream); | 36 static uint32_t SizeOfQueuedData(ReliableQuicStream* stream); |
35 | 37 |
36 static void SetFecPolicy(ReliableQuicStream* stream, FecPolicy fec_policy); | 38 static void SetFecPolicy(ReliableQuicStream* stream, FecPolicy fec_policy); |
37 | 39 |
38 static bool StreamContributesToConnectionFlowControl( | 40 static bool StreamContributesToConnectionFlowControl( |
39 ReliableQuicStream* stream); | 41 ReliableQuicStream* stream); |
40 | 42 |
41 static void WriteOrBufferData( | 43 static void WriteOrBufferData( |
42 ReliableQuicStream* stream, | 44 ReliableQuicStream* stream, |
43 base::StringPiece data, | 45 base::StringPiece data, |
44 bool fin, | 46 bool fin, |
45 QuicAckListenerInterface* ack_notifier_delegate); | 47 QuicAckListenerInterface* ack_notifier_delegate); |
46 | 48 |
47 private: | 49 private: |
48 DISALLOW_COPY_AND_ASSIGN(ReliableQuicStreamPeer); | 50 DISALLOW_COPY_AND_ASSIGN(ReliableQuicStreamPeer); |
49 }; | 51 }; |
50 | 52 |
51 } // namespace test | 53 } // namespace test |
52 } // namespace net | 54 } // namespace net |
53 | 55 |
54 #endif // NET_QUIC_TEST_TOOLS_RELIABLE_QUIC_STREAM_PEER_H_ | 56 #endif // NET_QUIC_TEST_TOOLS_RELIABLE_QUIC_STREAM_PEER_H_ |
OLD | NEW |