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

Unified Diff: net/spdy/hpack/hpack_decoder2.cc

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: address bnc comments Created 3 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 side-by-side diff with in-line comments
Download patch
Index: net/spdy/hpack/hpack_decoder2.cc
diff --git a/net/spdy/hpack/hpack_decoder2.cc b/net/spdy/hpack/hpack_decoder2.cc
index 03b1c2ef229415eb0322a972f1a5cbc40b96d1ae..ebaf51b2715a701369e86336f490b710d3aefa73 100644
--- a/net/spdy/hpack/hpack_decoder2.cc
+++ b/net/spdy/hpack/hpack_decoder2.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/strings/string_piece.h"
+#include "base/trace_event/memory_usage_estimator.h"
#include "net/http2/decoder/decode_buffer.h"
#include "net/http2/decoder/decode_status.h"
#include "net/spdy/hpack/hpack_entry.h"
@@ -159,6 +160,12 @@ void HpackDecoder2::set_max_decode_buffer_size_bytes(
max_decode_buffer_size_bytes_ = max_decode_buffer_size_bytes;
}
+size_t HpackDecoder2::EstimateMemoryUsage() const {
+ return header_table_.size() +
DmitrySkiba 2017/02/02 18:16:27 HpackHeaderTable::size() seems to be total size of
xunjieli 2017/02/03 22:25:09 Done.
+ base::trace_event::EstimateMemoryUsage(decoded_block_) +
+ name_.BufferedLength() + value_.BufferedLength();
+}
+
void HpackDecoder2::OnIndexedHeader(size_t index) {
DVLOG(2) << "HpackDecoder2::OnIndexedHeader: index=" << index;
DCHECK(!error_detected_);

Powered by Google App Engine
This is Rietveld 408576698