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

Unified Diff: net/spdy/hpack/hpack_decoder.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_decoder.h ('k') | net/spdy/hpack/hpack_decoder2.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/hpack/hpack_decoder.cc
diff --git a/net/spdy/hpack/hpack_decoder.cc b/net/spdy/hpack/hpack_decoder.cc
index 575a5c19b715a25d0989b9048e808b137da3231c..78e1f18110747da703ba45e58df4fcf57cfa3f55 100644
--- a/net/spdy/hpack/hpack_decoder.cc
+++ b/net/spdy/hpack/hpack_decoder.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "net/spdy/hpack/hpack_constants.h"
#include "net/spdy/hpack/hpack_entry.h"
+#include "net/spdy/platform/api/spdy_estimate_memory_usage.h"
#include "net/spdy/spdy_flags.h"
namespace net {
@@ -116,6 +117,14 @@ void HpackDecoder::set_max_decode_buffer_size_bytes(
max_decode_buffer_size_bytes_ = max_decode_buffer_size_bytes;
}
+size_t HpackDecoder::EstimateMemoryUsage() const {
+ return SpdyEstimateMemoryUsage(header_table_) +
+ SpdyEstimateMemoryUsage(headers_block_buffer_) +
+ SpdyEstimateMemoryUsage(decoded_block_) +
+ SpdyEstimateMemoryUsage(key_buffer_) +
+ SpdyEstimateMemoryUsage(value_buffer_);
+}
+
bool HpackDecoder::HandleHeaderRepresentation(StringPiece name,
StringPiece value) {
size_updates_allowed_ = false;
« no previous file with comments | « net/spdy/hpack/hpack_decoder.h ('k') | net/spdy/hpack/hpack_decoder2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698