| 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_STREAM_PEER_H_ | 5 #ifndef NET_QUIC_TEST_TOOLS_QUIC_STREAM_PEER_H_ |
| 6 #define NET_QUIC_TEST_TOOLS_QUIC_STREAM_PEER_H_ | 6 #define NET_QUIC_TEST_TOOLS_QUIC_STREAM_PEER_H_ |
| 7 | 7 |
| 8 #include <cstdint> | 8 #include <cstdint> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "net/quic/core/quic_packets.h" | 11 #include "net/quic/core/quic_packets.h" |
| 12 #include "net/quic/core/quic_stream_sequencer.h" | 12 #include "net/quic/core/quic_stream_sequencer.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 | 15 |
| 16 class QuicStream; | 16 class QuicStream; |
| 17 class QuicSession; | 17 class QuicSession; |
| 18 | 18 |
| 19 namespace test { | 19 namespace test { |
| 20 | 20 |
| 21 class QuicStreamPeer { | 21 class QuicStreamPeer { |
| 22 public: | 22 public: |
| 23 static void SetWriteSideClosed(bool value, QuicStream* stream); | 23 static void SetWriteSideClosed(bool value, QuicStream* stream); |
| 24 static void SetStreamBytesWritten(QuicStreamOffset stream_bytes_written, | 24 static void SetStreamBytesWritten(QuicStreamOffset stream_bytes_written, |
| 25 QuicStream* stream); | 25 QuicStream* stream); |
| 26 static bool read_side_closed(QuicStream* stream); | 26 static bool read_side_closed(QuicStream* stream); |
| 27 static void CloseReadSide(QuicStream* stream); | 27 static void CloseReadSide(QuicStream* stream); |
| 28 | 28 |
| 29 static bool FinSent(QuicStream* stream); | 29 static bool FinSent(QuicStream* stream); |
| 30 static bool FinReceived(QuicStream* stream); | |
| 31 static bool RstSent(QuicStream* stream); | 30 static bool RstSent(QuicStream* stream); |
| 32 static bool RstReceived(QuicStream* stream); | |
| 33 | |
| 34 static bool ReadSideClosed(QuicStream* stream); | |
| 35 static bool WriteSideClosed(QuicStream* stream); | |
| 36 | 31 |
| 37 static uint32_t SizeOfQueuedData(QuicStream* stream); | 32 static uint32_t SizeOfQueuedData(QuicStream* stream); |
| 38 | 33 |
| 39 static bool StreamContributesToConnectionFlowControl(QuicStream* stream); | 34 static bool StreamContributesToConnectionFlowControl(QuicStream* stream); |
| 40 | 35 |
| 41 static void WriteOrBufferData( | 36 static void WriteOrBufferData( |
| 42 QuicStream* stream, | 37 QuicStream* stream, |
| 43 base::StringPiece data, | 38 base::StringPiece data, |
| 44 bool fin, | 39 bool fin, |
| 45 QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener); | 40 QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener); |
| 46 | 41 |
| 47 static QuicStreamSequencer* sequencer(QuicStream* stream); | 42 static QuicStreamSequencer* sequencer(QuicStream* stream); |
| 48 static QuicSession* session(QuicStream* stream); | 43 static QuicSession* session(QuicStream* stream); |
| 49 | 44 |
| 50 private: | 45 private: |
| 51 DISALLOW_COPY_AND_ASSIGN(QuicStreamPeer); | 46 DISALLOW_COPY_AND_ASSIGN(QuicStreamPeer); |
| 52 }; | 47 }; |
| 53 | 48 |
| 54 } // namespace test | 49 } // namespace test |
| 55 | 50 |
| 56 } // namespace net | 51 } // namespace net |
| 57 | 52 |
| 58 #endif // NET_QUIC_TEST_TOOLS_QUIC_STREAM_PEER_H_ | 53 #endif // NET_QUIC_TEST_TOOLS_QUIC_STREAM_PEER_H_ |
| OLD | NEW |