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

Side by Side Diff: net/quic/test_tools/reliable_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
« no previous file with comments | « net/quic/test_tools/reliable_quic_stream_peer.h ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/reliable_quic_stream_peer.h"
6
7 #include <list>
8
9 #include "net/quic/core/reliable_quic_stream.h"
10
11 using base::StringPiece;
12
13 namespace net {
14 namespace test {
15
16 // static
17 void ReliableQuicStreamPeer::SetWriteSideClosed(bool value,
18 ReliableQuicStream* stream) {
19 stream->write_side_closed_ = value;
20 }
21
22 // static
23 void ReliableQuicStreamPeer::SetStreamBytesWritten(
24 QuicStreamOffset stream_bytes_written,
25 ReliableQuicStream* stream) {
26 stream->stream_bytes_written_ = stream_bytes_written;
27 }
28
29 // static
30 bool ReliableQuicStreamPeer::read_side_closed(ReliableQuicStream* stream) {
31 return stream->read_side_closed();
32 }
33
34 // static
35 void ReliableQuicStreamPeer::CloseReadSide(ReliableQuicStream* stream) {
36 stream->CloseReadSide();
37 }
38
39 // static
40 bool ReliableQuicStreamPeer::FinSent(ReliableQuicStream* stream) {
41 return stream->fin_sent_;
42 }
43
44 // static
45 bool ReliableQuicStreamPeer::FinReceived(ReliableQuicStream* stream) {
46 return stream->fin_received_;
47 }
48
49 // static
50 bool ReliableQuicStreamPeer::RstSent(ReliableQuicStream* stream) {
51 return stream->rst_sent_;
52 }
53
54 // static
55 bool ReliableQuicStreamPeer::RstReceived(ReliableQuicStream* stream) {
56 return stream->rst_received_;
57 }
58
59 // static
60 bool ReliableQuicStreamPeer::ReadSideClosed(ReliableQuicStream* stream) {
61 return stream->read_side_closed_;
62 }
63
64 // static
65 bool ReliableQuicStreamPeer::WriteSideClosed(ReliableQuicStream* stream) {
66 return stream->write_side_closed_;
67 }
68
69 // static
70 uint32_t ReliableQuicStreamPeer::SizeOfQueuedData(ReliableQuicStream* stream) {
71 uint32_t total = 0;
72 std::list<ReliableQuicStream::PendingData>::iterator it =
73 stream->queued_data_.begin();
74 while (it != stream->queued_data_.end()) {
75 total += it->data.size();
76 ++it;
77 }
78 return total;
79 }
80
81 // static
82 bool ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl(
83 ReliableQuicStream* stream) {
84 return stream->stream_contributes_to_connection_flow_control_;
85 }
86
87 // static
88 void ReliableQuicStreamPeer::WriteOrBufferData(
89 ReliableQuicStream* stream,
90 StringPiece data,
91 bool fin,
92 QuicAckListenerInterface* ack_notifier_delegate) {
93 stream->WriteOrBufferData(data, fin, ack_notifier_delegate);
94 }
95
96 // static
97 net::QuicStreamSequencer* ReliableQuicStreamPeer::sequencer(
98 ReliableQuicStream* stream) {
99 return &(stream->sequencer_);
100 }
101
102 } // namespace test
103 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/reliable_quic_stream_peer.h ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698