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

Unified Diff: net/quic/quic_stream_sequencer.cc

Issue 2129723002: Adds a DebugString method to QuicStreamSequencer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@126189095
Patch Set: Use base::IntToString Created 4 years, 5 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
« no previous file with comments | « net/quic/quic_stream_sequencer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_stream_sequencer.cc
diff --git a/net/quic/quic_stream_sequencer.cc b/net/quic/quic_stream_sequencer.cc
index da26cc52fa9d4ad6470b7e6a531031a8c6563c8c..f6f0182507ba86b9e67c4d5022caac74179f424f 100644
--- a/net/quic/quic_stream_sequencer.cc
+++ b/net/quic/quic_stream_sequencer.cc
@@ -19,6 +19,7 @@
#include "net/quic/quic_utils.h"
#include "net/quic/reliable_quic_stream.h"
+using base::IntToString;
using base::StringPiece;
using std::min;
using std::numeric_limits;
@@ -158,7 +159,7 @@ void QuicStreamSequencer::MarkConsumed(size_t num_bytes_consumed) {
if (!result) {
QUIC_BUG << "Invalid argument to MarkConsumed."
<< " expect to consume: " << num_bytes_consumed
- << ", but not enough bytes available.";
+ << ", but not enough bytes available. " << DebugString();
stream_->Reset(QUIC_ERROR_PROCESSING_STREAM);
return;
}
@@ -202,4 +203,16 @@ QuicStreamOffset QuicStreamSequencer::NumBytesConsumed() const {
return buffered_frames_.BytesConsumed();
}
+const string QuicStreamSequencer::DebugString() const {
+ // clang-format off
+ return "QuicStreamSequencer:"
+ "\n bytes buffered: " + IntToString(NumBytesBuffered()) +
+ "\n bytes consumed: " + IntToString( NumBytesConsumed()) +
+ "\n has bytes to read: " + (HasBytesToRead() ? "true" : "false") +
+ "\n frames received: " + IntToString(num_frames_received()) +
+ "\n close offset bytes: " + IntToString( close_offset_) +
+ "\n is closed: " + (IsClosed() ? "true" : "false");
+ // clang-format on
+}
+
} // namespace net
« no previous file with comments | « net/quic/quic_stream_sequencer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698