| 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 #include "net/quic/platform/api/quic_string_piece.h" |
| 13 | 14 |
| 14 namespace net { | 15 namespace net { |
| 15 | 16 |
| 16 class QuicStream; | 17 class QuicStream; |
| 17 class QuicSession; | 18 class QuicSession; |
| 18 | 19 |
| 19 namespace test { | 20 namespace test { |
| 20 | 21 |
| 21 class QuicStreamPeer { | 22 class QuicStreamPeer { |
| 22 public: | 23 public: |
| 23 static void SetWriteSideClosed(bool value, QuicStream* stream); | 24 static void SetWriteSideClosed(bool value, QuicStream* stream); |
| 24 static void SetStreamBytesWritten(QuicStreamOffset stream_bytes_written, | 25 static void SetStreamBytesWritten(QuicStreamOffset stream_bytes_written, |
| 25 QuicStream* stream); | 26 QuicStream* stream); |
| 26 static bool read_side_closed(QuicStream* stream); | 27 static bool read_side_closed(QuicStream* stream); |
| 27 static void CloseReadSide(QuicStream* stream); | 28 static void CloseReadSide(QuicStream* stream); |
| 28 | 29 |
| 29 static bool FinSent(QuicStream* stream); | 30 static bool FinSent(QuicStream* stream); |
| 30 static bool RstSent(QuicStream* stream); | 31 static bool RstSent(QuicStream* stream); |
| 31 | 32 |
| 32 static uint32_t SizeOfQueuedData(QuicStream* stream); | 33 static uint32_t SizeOfQueuedData(QuicStream* stream); |
| 33 | 34 |
| 34 static bool StreamContributesToConnectionFlowControl(QuicStream* stream); | 35 static bool StreamContributesToConnectionFlowControl(QuicStream* stream); |
| 35 | 36 |
| 36 static void WriteOrBufferData( | 37 static void WriteOrBufferData( |
| 37 QuicStream* stream, | 38 QuicStream* stream, |
| 38 base::StringPiece data, | 39 QuicStringPiece data, |
| 39 bool fin, | 40 bool fin, |
| 40 QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener); | 41 QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener); |
| 41 | 42 |
| 42 static QuicStreamSequencer* sequencer(QuicStream* stream); | 43 static QuicStreamSequencer* sequencer(QuicStream* stream); |
| 43 static QuicSession* session(QuicStream* stream); | 44 static QuicSession* session(QuicStream* stream); |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 DISALLOW_COPY_AND_ASSIGN(QuicStreamPeer); | 47 DISALLOW_COPY_AND_ASSIGN(QuicStreamPeer); |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 } // namespace test | 50 } // namespace test |
| 50 | 51 |
| 51 } // namespace net | 52 } // namespace net |
| 52 | 53 |
| 53 #endif // NET_QUIC_TEST_TOOLS_QUIC_STREAM_PEER_H_ | 54 #endif // NET_QUIC_TEST_TOOLS_QUIC_STREAM_PEER_H_ |
| OLD | NEW |