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

Unified Diff: blimp/net/stream_packet_reader.cc

Issue 1962393004: Added a debug info UI for Blimp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added empty implementation for linux client Created 4 years, 7 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 | « blimp/net/stream_packet_reader.h ('k') | blimp/net/stream_packet_reader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/net/stream_packet_reader.cc
diff --git a/blimp/net/stream_packet_reader.cc b/blimp/net/stream_packet_reader.cc
index 8e675b32c8b3bfe511d07c84bb7fdfd9d8e85c52..6cd91642f8596cf85e3da1d0a6a94acc42c3cd30 100644
--- a/blimp/net/stream_packet_reader.cc
+++ b/blimp/net/stream_packet_reader.cc
@@ -11,6 +11,7 @@
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/sys_byteorder.h"
+#include "blimp/net/blimp_connection_statistics.h"
#include "blimp/net/common.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
@@ -34,8 +35,12 @@ std::ostream& operator<<(std::ostream& out,
return out;
}
-StreamPacketReader::StreamPacketReader(net::StreamSocket* socket)
- : read_state_(ReadState::IDLE), socket_(socket), weak_factory_(this) {
+StreamPacketReader::StreamPacketReader(net::StreamSocket* socket,
+ BlimpConnectionStatistics* statistics)
+ : read_state_(ReadState::IDLE),
+ socket_(socket),
+ statistics_(statistics),
+ weak_factory_(this) {
DCHECK(socket_);
header_buffer_ = new net::GrowableIOBuffer;
header_buffer_->SetCapacity(kPacketHeaderSizeBytes);
@@ -138,6 +143,7 @@ int StreamPacketReader::DoReadPayload(int result) {
base::Bind(&StreamPacketReader::OnReadComplete,
weak_factory_.GetWeakPtr()));
}
+ statistics_->Add(BlimpConnectionStatistics::BYTES_RECEIVED, payload_size_);
// Finished reading the payload.
read_state_ = ReadState::IDLE;
« no previous file with comments | « blimp/net/stream_packet_reader.h ('k') | blimp/net/stream_packet_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698