This source file includes following definitions.
- SetWriteSideClosed
- SetStreamBytesWritten
- CloseReadSide
- FinSent
- RstSent
- SetFlowControlSendOffset
- SetFlowControlReceiveOffset
- SetFlowControlMaxReceiveWindow
- SendWindowOffset
- SendWindowSize
- ReceiveWindowOffset
- ReceiveWindowSize
- SizeOfQueuedData
#include "net/quic/test_tools/reliable_quic_stream_peer.h"
#include <list>
#include "net/quic/reliable_quic_stream.h"
namespace net {
namespace test {
void ReliableQuicStreamPeer::SetWriteSideClosed(bool value,
ReliableQuicStream* stream) {
stream->write_side_closed_ = value;
}
void ReliableQuicStreamPeer::SetStreamBytesWritten(
QuicStreamOffset stream_bytes_written,
ReliableQuicStream* stream) {
stream->stream_bytes_written_ = stream_bytes_written;
}
void ReliableQuicStreamPeer::CloseReadSide(ReliableQuicStream* stream) {
stream->CloseReadSide();
}
bool ReliableQuicStreamPeer::FinSent(ReliableQuicStream* stream) {
return stream->fin_sent_;
}
bool ReliableQuicStreamPeer::RstSent(ReliableQuicStream* stream) {
return stream->rst_sent_;
}
void ReliableQuicStreamPeer::SetFlowControlSendOffset(
ReliableQuicStream* stream,
QuicStreamOffset offset) {
stream->flow_control_send_limit_ = offset;
}
void ReliableQuicStreamPeer::SetFlowControlReceiveOffset(
ReliableQuicStream* stream,
QuicStreamOffset offset) {
stream->flow_control_receive_window_offset_bytes_ = offset;
}
void ReliableQuicStreamPeer::SetFlowControlMaxReceiveWindow(
ReliableQuicStream* stream,
uint64 window_size) {
stream->max_flow_control_receive_window_bytes_ = window_size;
}
QuicStreamOffset ReliableQuicStreamPeer::SendWindowOffset(
ReliableQuicStream* stream) {
return stream->flow_control_send_limit_;
}
QuicStreamOffset ReliableQuicStreamPeer::SendWindowSize(
ReliableQuicStream* stream) {
return stream->SendWindowSize();
}
QuicStreamOffset ReliableQuicStreamPeer::ReceiveWindowOffset(
ReliableQuicStream* stream) {
return stream->flow_control_receive_window_offset_bytes_;
}
uint64 ReliableQuicStreamPeer::ReceiveWindowSize(ReliableQuicStream* stream) {
return stream->flow_control_receive_window_offset_bytes_ -
stream->TotalReceivedBytes();
}
uint32 ReliableQuicStreamPeer::SizeOfQueuedData(ReliableQuicStream* stream) {
uint32 total = 0;
std::list<ReliableQuicStream::PendingData>::iterator it =
stream->queued_data_.begin();
while (it != stream->queued_data_.end()) {
total += it->data.size();
++it;
}
return total;
}
}
}