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

Side by Side Diff: net/quic/quic_protocol.cc

Issue 11973021: Teach gtest how to print QuicConsumedData and QuicEncryptedPacket. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Sync with ToT Created 7 years, 11 months 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_protocol.h ('k') | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "net/quic/quic_protocol.h" 5 #include "net/quic/quic_protocol.h"
6 #include "base/stl_util.h" 6 #include "base/stl_util.h"
7 7
8 using base::StringPiece; 8 using base::StringPiece;
9 using std::map; 9 using std::map;
10 using std::numeric_limits; 10 using std::numeric_limits;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 QuicPacketSequenceNumber least_unacked) { 72 QuicPacketSequenceNumber least_unacked) {
73 for (QuicPacketSequenceNumber seq_num = 1; 73 for (QuicPacketSequenceNumber seq_num = 1;
74 seq_num <= largest_observed; ++seq_num) { 74 seq_num <= largest_observed; ++seq_num) {
75 received_info.RecordReceived(seq_num); 75 received_info.RecordReceived(seq_num);
76 } 76 }
77 received_info.largest_observed = largest_observed; 77 received_info.largest_observed = largest_observed;
78 sent_info.least_unacked = least_unacked; 78 sent_info.least_unacked = least_unacked;
79 } 79 }
80 80
81 ostream& operator<<(ostream& os, const SentPacketInfo& sent_info) { 81 ostream& operator<<(ostream& os, const SentPacketInfo& sent_info) {
82 os << "least_waiting: " << sent_info.least_unacked; 82 os << "least_unacked: " << sent_info.least_unacked;
83 return os; 83 return os;
84 } 84 }
85 85
86 ostream& operator<<(ostream& os, const ReceivedPacketInfo& received_info) { 86 ostream& operator<<(ostream& os, const ReceivedPacketInfo& received_info) {
87 os << "largest_observed: " 87 os << "largest_observed: "
88 << received_info.largest_observed 88 << received_info.largest_observed
89 << " missing_packets: [ "; 89 << " missing_packets: [ ";
90 for (SequenceSet::const_iterator it = received_info.missing_packets.begin(); 90 for (SequenceSet::const_iterator it = received_info.missing_packets.begin();
91 it != received_info.missing_packets.end(); ++it) { 91 it != received_info.missing_packets.end(); ++it) {
92 os << *it << " "; 92 os << *it << " ";
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 return true; 163 return true;
164 } 164 }
165 165
166 QuicData::~QuicData() { 166 QuicData::~QuicData() {
167 if (owns_buffer_) { 167 if (owns_buffer_) {
168 delete [] const_cast<char*>(buffer_); 168 delete [] const_cast<char*>(buffer_);
169 } 169 }
170 } 170 }
171 171
172 ostream& operator<<(ostream& os, const QuicEncryptedPacket& s) {
173 os << s.length() << "-byte data";
174 return os;
175 }
176
177 ostream& operator<<(ostream& os, const QuicConsumedData& s) {
178 os << "bytes_consumed: " << s.bytes_consumed
179 << " fin_consumed: " << s.fin_consumed;
180 return os;
181 }
182
172 } // namespace net 183 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.h ('k') | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698