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
3 // found in the LICENSE file.
5 #include "net/quic/test_tools/reliable_quic_stream_peer.h"
9 #include "net/quic/reliable_quic_stream.h"
11 using base::StringPiece
;
17 void ReliableQuicStreamPeer::SetWriteSideClosed(bool value
,
18 ReliableQuicStream
* stream
) {
19 stream
->write_side_closed_
= value
;
23 void ReliableQuicStreamPeer::SetStreamBytesWritten(
24 QuicStreamOffset stream_bytes_written
,
25 ReliableQuicStream
* stream
) {
26 stream
->stream_bytes_written_
= stream_bytes_written
;
30 void ReliableQuicStreamPeer::CloseReadSide(ReliableQuicStream
* stream
) {
31 stream
->CloseReadSide();
35 bool ReliableQuicStreamPeer::FinSent(ReliableQuicStream
* stream
) {
36 return stream
->fin_sent_
;
40 bool ReliableQuicStreamPeer::RstSent(ReliableQuicStream
* stream
) {
41 return stream
->rst_sent_
;
45 uint32
ReliableQuicStreamPeer::SizeOfQueuedData(ReliableQuicStream
* stream
) {
47 std::list
<ReliableQuicStream::PendingData
>::iterator it
=
48 stream
->queued_data_
.begin();
49 while (it
!= stream
->queued_data_
.end()) {
50 total
+= it
->data
.size();
57 void ReliableQuicStreamPeer::SetFecPolicy(ReliableQuicStream
* stream
,
58 FecPolicy fec_policy
) {
59 stream
->set_fec_policy(fec_policy
);
63 bool ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl(
64 ReliableQuicStream
* stream
) {
65 return stream
->stream_contributes_to_connection_flow_control_
;
69 void ReliableQuicStreamPeer::WriteOrBufferData(
70 ReliableQuicStream
* stream
,
73 QuicAckNotifier::DelegateInterface
* ack_notifier_delegate
) {
74 stream
->WriteOrBufferData(data
, fin
, ack_notifier_delegate
);