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

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

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: rebased Created 3 years, 10 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/spdy/hpack/hpack_decoder2.h ('k') | net/spdy/hpack/hpack_decoder3.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..14ff94e990f38afd6bee7c271f251cf73c5c81a7 100644
--- a/net/spdy/hpack/hpack_decoder2.cc
+++ b/net/spdy/hpack/hpack_decoder2.cc
@@ -12,6 +12,7 @@
#include "net/http2/decoder/decode_buffer.h"
#include "net/http2/decoder/decode_status.h"
#include "net/spdy/hpack/hpack_entry.h"
+#include "net/spdy/platform/api/spdy_estimate_memory_usage.h"
using base::StringPiece;
@@ -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 SpdyEstimateMemoryUsage(header_table_) +
+ SpdyEstimateMemoryUsage(decoded_block_) +
+ SpdyEstimateMemoryUsage(name_) + SpdyEstimateMemoryUsage(value_);
+}
+
void HpackDecoder2::OnIndexedHeader(size_t index) {
DVLOG(2) << "HpackDecoder2::OnIndexedHeader: index=" << index;
DCHECK(!error_detected_);
« no previous file with comments | « net/spdy/hpack/hpack_decoder2.h ('k') | net/spdy/hpack/hpack_decoder3.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698