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

Unified Diff: net/quic/quic_connection.cc

Issue 17518002: Add logging to the QUIC write path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/quic_connection.cc
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index 9932032f0ac3b2b868dc9c615c9f08e6e8caa499..88bb2f13179d8021d20dddd9252e1ddc9fde263f 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -83,7 +83,7 @@ QuicConnection::QuicConnection(QuicGuid guid,
write_blocked_(false),
debug_visitor_(NULL),
packet_creator_(guid_, &framer_, random_generator_, is_server),
- packet_generator_(this, &packet_creator_),
+ packet_generator_(this, NULL, &packet_creator_),
idle_network_timeout_(
QuicTime::Delta::FromSeconds(kDefaultInitialTimeoutSecs)),
overall_connection_timeout_(QuicTime::Delta::Infinite()),
@@ -1091,7 +1091,7 @@ bool QuicConnection::WritePacket(EncryptionLevel level,
int error;
QuicTime now = clock_->Now();
- if (helper_->WritePacketToWire(*encrypted, &error) == -1) {
+ if (WritePacketToWire(sequence_number, level, *encrypted, &error) == -1) {
if (helper_->IsWriteBlocked(error)) {
// TODO(satyashekhar): It might be more efficient (fewer system calls), if
// all connections share this variable i.e this becomes a part of
@@ -1136,6 +1136,18 @@ bool QuicConnection::WritePacket(EncryptionLevel level,
return true;
}
+int QuicConnection::WritePacketToWire(QuicPacketSequenceNumber sequence_number,
+ EncryptionLevel level,
+ const QuicEncryptedPacket& packet,
+ int* error) {
+ int rv = helper_->WritePacketToWire(packet, error);
+ if (debug_visitor_) {
+ debug_visitor_->OnPacketSent(sequence_number, level, packet,
+ rv == -1 ? *error : rv);
eroman 2013/06/20 22:20:04 What is the range of |*error|? Is it a NetError c
Ryan Hamilton 2013/06/20 22:44:16 -1 == error, otherwise positive values equal the n
+ }
+ return rv;
+}
+
bool QuicConnection::OnSerializedPacket(
const SerializedPacket& serialized_packet) {
if (serialized_packet.retransmittable_frames != NULL) {

Powered by Google App Engine
This is Rietveld 408576698