Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: net/quic/test_tools/quic_stream_peer.cc

Issue 2487613002: Landing Recent QUIC changes until 12:43 PM, Nov 5, 2016 UTC+8 (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #include "net/quic/test_tools/quic_stream_peer.h"
6
7 #include <list>
8
9 #include "net/quic/core/quic_stream.h"
10
11 using base::StringPiece;
12
13 namespace net {
14 namespace test {
15
16 // static
17 void QuicStreamPeer::SetWriteSideClosed(bool value, QuicStream* stream) {
18 stream->write_side_closed_ = value;
19 }
20
21 // static
22 void QuicStreamPeer::SetStreamBytesWritten(
23 QuicStreamOffset stream_bytes_written,
24 QuicStream* stream) {
25 stream->stream_bytes_written_ = stream_bytes_written;
26 }
27
28 // static
29 bool QuicStreamPeer::read_side_closed(QuicStream* stream) {
30 return stream->read_side_closed();
31 }
32
33 // static
34 void QuicStreamPeer::CloseReadSide(QuicStream* stream) {
35 stream->CloseReadSide();
36 }
37
38 // static
39 bool QuicStreamPeer::FinSent(QuicStream* stream) {
40 return stream->fin_sent_;
41 }
42
43 // static
44 bool QuicStreamPeer::FinReceived(QuicStream* stream) {
45 return stream->fin_received_;
46 }
47
48 // static
49 bool QuicStreamPeer::RstSent(QuicStream* stream) {
50 return stream->rst_sent_;
51 }
52
53 // static
54 bool QuicStreamPeer::RstReceived(QuicStream* stream) {
55 return stream->rst_received_;
56 }
57
58 // static
59 bool QuicStreamPeer::ReadSideClosed(QuicStream* stream) {
60 return stream->read_side_closed_;
61 }
62
63 // static
64 bool QuicStreamPeer::WriteSideClosed(QuicStream* stream) {
65 return stream->write_side_closed_;
66 }
67
68 // static
69 uint32_t QuicStreamPeer::SizeOfQueuedData(QuicStream* stream) {
70 uint32_t total = 0;
71 std::list<QuicStream::PendingData>::iterator it =
72 stream->queued_data_.begin();
73 while (it != stream->queued_data_.end()) {
74 total += it->data.size();
75 ++it;
76 }
77 return total;
78 }
79
80 // static
81 bool QuicStreamPeer::StreamContributesToConnectionFlowControl(
82 QuicStream* stream) {
83 return stream->stream_contributes_to_connection_flow_control_;
84 }
85
86 // static
87 void QuicStreamPeer::WriteOrBufferData(
88 QuicStream* stream,
89 StringPiece data,
90 bool fin,
91 QuicAckListenerInterface* ack_notifier_delegate) {
92 stream->WriteOrBufferData(data, fin, ack_notifier_delegate);
93 }
94
95 // static
96 net::QuicStreamSequencer* QuicStreamPeer::sequencer(QuicStream* stream) {
97 return &(stream->sequencer_);
98 }
99
100 } // namespace test
101 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_stream_peer.h ('k') | net/quic/test_tools/quic_stream_sequencer_buffer_peer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698